File: __init__.py

package info (click to toggle)
rope 0.10.3-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,748 kB
  • ctags: 4,218
  • sloc: python: 25,494; sh: 8; makefile: 3
file content (32 lines) | stat: -rw-r--r-- 845 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import os.path
import subprocess
try:
    import unittest2 as unittest
except ImportError:
    import unittest


class TestCVE20143539(unittest.TestCase):
    def test_case(self):
        cur_dir = os.path.dirname(__file__)
        script_name = os.path.join(cur_dir, 'run_reproducer.sh')
        pid = subprocess.Popen([script_name], stdout=subprocess.PIPE,
                               stderr=subprocess.PIPE, cwd=cur_dir)
        pid.communicate()
        self.assertEquals(pid.returncode, 0)


def suite():
    result = unittest.TestSuite()
    result.addTests(unittest.makeSuite(TestCVE20143539))
    return result


if __name__ == '__main__':
    import sys
    if len(sys.argv) > 1:
        unittest.main()
    else:
        runner = unittest.TextTestRunner()
        res = runner.run(suite())
        sys.exit(not res.wasSuccessful())