|
@@ 92-102 (lines=11) @@
|
| 89 |
|
|
| 90 |
|
class Test_20_Base(RunTestBase): |
| 91 |
|
|
| 92 |
|
def setUp(self): |
| 93 |
|
self.workdir = tests.common.setup_workdir() |
| 94 |
|
self.script = os.path.join(tests.common.selfdir(), |
| 95 |
|
"..", "cli.py") |
| 96 |
|
|
| 97 |
|
def tearDown(self): |
| 98 |
|
tests.common.cleanup_workdir(self.workdir) |
| 99 |
|
|
| 100 |
|
def _assert_run_and_exit(self, *args): |
| 101 |
|
raised = False |
| 102 |
|
try: |
| 103 |
|
_run(*args) |
| 104 |
|
except SystemExit: |
| 105 |
|
raised = True |
|
@@ 173-182 (lines=10) @@
|
| 170 |
|
assert not os.path.exists(infile) |
| 171 |
|
|
| 172 |
|
self.assertFalse(TT.main(["dummy", "-O", "json", |
| 173 |
|
"--ignore-missing", infile])) |
| 174 |
|
|
| 175 |
|
def test_50_w_schema(self): |
| 176 |
|
(infile, scmfile) = (CNF_0_PATH, SCM_0_PATH) |
| 177 |
|
output = os.path.join(self.workdir, "output.json") |
| 178 |
|
self.run_and_check_exit_code(["--schema", scmfile, "--validate", |
| 179 |
|
infile], 0) |
| 180 |
|
self.run_and_check_exit_code(["--schema", scmfile, "-o", output, |
| 181 |
|
infile], 0) |
| 182 |
|
|
| 183 |
|
infile2 = os.path.join(self.workdir, "input.yml") |
| 184 |
|
cnf = CNF_0.copy() |
| 185 |
|
cnf["a"] = "aaa" # Validation should fail. |