Pass over a data source whose script the image cannot run

This commit is contained in:
2026-11-23 20:37:46 +01:00
parent 5727456738
commit c9948496eb
5 changed files with 34 additions and 11 deletions
+3 -1
View File
@@ -632,7 +632,9 @@ class ContainersTest(unittest.TestCase):
def test_a_run_whose_command_never_started_is_a_failure_that_says_what_docker_printed(self):
for code in (125, 126, 127):
self.assertEqual(ran_tests(self.containers(run=Ran(code, "sh: gotestsum: not found\n")), "/tree"), Failure(f"docker run could not start its command, and exited {code}: sh: gotestsum: not found"))
ran = ran_tests(self.containers(run=Ran(code, "sh: gotestsum: not found\n")), "/tree")
self.assertIsInstance(ran, Failure)
self.assertEqual(ran.reason, f"docker run could not start its command, and exited {code}: sh: gotestsum: not found")
self.assertEqual(ran_tests(self.containers(run=Ran(124, "late")), "/tree"), Ran(124, "late"))
self.assertEqual(ran_tests(self.containers(run=Ran(128, "killed")), "/tree"), Ran(128, "killed"))
self.assertEqual(fix_attempted(self.containers(run=Ran(125, "")), "/tree", "got 3", self.stream), Failure(f"docker run could not start its command, and exited 125; its errors are in {self.stream.with_suffix('.stderr')}"))