Test the commands a gate read runs, a parked chunk's window calls and the failures of unparking

This commit is contained in:
2026-11-18 23:29:04 +01:00
parent 2dcf93a55f
commit 0eea8aa10d
4 changed files with 38 additions and 7 deletions
+6
View File
@@ -46,6 +46,12 @@ class ParkedChunks(unittest.TestCase):
self.assertIsInstance(failed, Failure)
self.assertIn(f"cannot read the parked chunk in {file}: ", failed.reason)
def test_fails_naming_the_file_it_cannot_remove(self):
park(self.folder, Parked("ABC-21", "/w", "7", "s", "an approval"))
file_of(self.folder, "ABC-21").parent.chmod(0o555)
self.addCleanup(file_of(self.folder, "ABC-21").parent.chmod, 0o755)
self.assertEqual(unpark(self.folder, "ABC-21"), Failure(f"cannot remove {file_of(self.folder, 'ABC-21')}: Permission denied"))
def test_fails_where_the_folder_cannot_be_written(self):
(self.folder / "parked").write_text("a file")
self.assertIn(f"cannot record the parked chunk in {file_of(self.folder, 'ABC-21')}: ", park(self.folder, CHUNK).reason)