@@ 56-73 (lines=18) @@ | ||
53 | ||
54 | ||
55 | class Test_10(RunTestBase): |
|
56 | ||
57 | def test_10_show_usage(self): |
|
58 | self.run_and_check_exit_code(["--help"]) |
|
59 | ||
60 | def test_20_wo_args(self): |
|
61 | self.run_and_check_exit_code(_not=True) |
|
62 | ||
63 | def test_30_wrong_option(self): |
|
64 | self.run_and_check_exit_code(["--wrong-option-xyz"], _not=True) |
|
65 | ||
66 | def test_40_list(self): |
|
67 | self.run_and_check_exit_code(["--list"]) |
|
68 | ||
69 | ||
70 | class Test_20_Base(RunTestBase): |
|
71 | ||
72 | def setUp(self): |
|
73 | self.workdir = tests.common.setup_workdir() |
|
74 | self.script = os.path.join(tests.common.selfdir(), |
|
75 | "..", "cli.py") |
|
76 |
@@ 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 |