diff options
Diffstat (limited to 'tests/test_first_light.py')
| -rw-r--r-- | tests/test_first_light.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/test_first_light.py b/tests/test_first_light.py index f8cca7b72..dc2db8728 100644 --- a/tests/test_first_light.py +++ b/tests/test_first_light.py | |||
| @@ -338,9 +338,26 @@ class RunFolderTests(unittest.TestCase): | |||
| 338 | work, outside = self.linked(kind, "") | 338 | work, outside = self.linked(kind, "") |
| 339 | with self.assertRaises(SystemExit) as refused: | 339 | with self.assertRaises(SystemExit) as refused: |
| 340 | fl.reset_run_folders(str(work)) | 340 | fl.reset_run_folders(str(work)) |
| 341 | self.assertIn(str(work / "first_light" / "dxbc"), str(refused.exception)) | 341 | self.assertIn(str(work / "first_light"), str(refused.exception)) |
| 342 | self.assertNotIn("\n", str(refused.exception)) | ||
| 342 | self.assertEqual(self.files(outside), ["dxbc/keep.dxbc", "keep.dxbc"]) | 343 | self.assertEqual(self.files(outside), ["dxbc/keep.dxbc", "keep.dxbc"]) |
| 343 | 344 | ||
| 345 | def test_a_linked_first_light_with_no_run_folders_is_refused_too(self) -> None: | ||
| 346 | # Nothing stale lies behind the link, so only the check of first_light itself can refuse it; without that | ||
| 347 | # check the new dxbc was created in the folder the link points to, outside the work folder. | ||
| 348 | for kind in LINK_KINDS: | ||
| 349 | with self.subTest(kind=kind): | ||
| 350 | work, outside = self.tmp / kind / "work", self.tmp / kind / "outside" | ||
| 351 | outside.mkdir(parents=True) | ||
| 352 | work.mkdir() | ||
| 353 | if not link_folder(kind, work / "first_light", outside): | ||
| 354 | self.skipTest(f"cannot create a {kind} here") | ||
| 355 | with self.assertRaises(SystemExit) as refused: | ||
| 356 | fl.reset_run_folders(str(work)) | ||
| 357 | self.assertIn(str(work / "first_light"), str(refused.exception)) | ||
| 358 | self.assertNotIn("\n", str(refused.exception)) | ||
| 359 | self.assertEqual(os.listdir(outside), []) | ||
| 360 | |||
| 344 | def test_a_file_that_cannot_be_removed_stops_the_run(self) -> None: | 361 | def test_a_file_that_cannot_be_removed_stops_the_run(self) -> None: |
| 345 | self.prepare("first") | 362 | self.prepare("first") |
| 346 | held = self.staged / "first.dxbc" | 363 | held = self.staged / "first.dxbc" |