Code Duplication    Length = 15-18 lines in 2 locations

tests/lib.py 1 location

@@ 28-42 (lines=15) @@
25
    return proc.communicate()[0]
26
27
28
class Test(unittest.TestCase):
29
30
    def setUp(self):
31
        self.workdir = tests.common.setup_workdir()
32
        self.script = os.path.join(self.workdir, "a.py")
33
34
    def tearDown(self):
35
        tests.common.cleanup_workdir(self.workdir)
36
37
    def test_00_run_script(self):
38
        with open(self.script, 'w') as fileobj:
39
            fileobj.write(SCRIPT_TO_USE_ANYCONFIG)
40
41
            out = check_output(["python", self.script])
42
            self.assertTrue(out in (b'', ''))
43
44
# vim:sw=4:ts=4:et:
45

tests/cli.py 1 location

@@ 70-87 (lines=18) @@
67
    def test_40_list(self):
68
        self.run_and_check_exit_code(["--list"])
69
70
    def test_50_unknown_input_file_type(self):
71
        self.run_and_check_exit_code([__file__], _not=True)
72
73
    def test_52_unknown_input_parser_type(self):
74
        self.run_and_check_exit_code([__file__, "-I", "unknown_psr"],
75
                                     _not=True)
76
77
    def test_54_no_input_type_and_unknown_out_file_type(self):
78
        self.run_and_check_exit_code([__file__, __file__ + '.un_ext'],
79
                                     _not=True)
80
81
    def test_60_unknown_out_file_type(self):
82
        self.run_and_check_exit_code([self.infile, "-o", "t.unknown_ext"],
83
                                     _not=True)
84
85
    def test_62_unknown_out_parser_type(self):
86
        self.run_and_check_exit_code([self.infile, "-O", "unknown_psr"],
87
                                     _not=True)
88
89
90
class Test_20_Base(RunTestBase):