Answer principles round 1: 0 🔴, 5 🟡 (0 misread); make a move a union with ToStatus, take only parsed events in figures, catch OSError at each file operation, pass progress through the bench, type the sides, and split the README bullet
CI / tests (pull_request) Successful in 5m4s
CI / tests (pull_request) Successful in 5m4s
This commit is contained in:
@@ -450,7 +450,7 @@ class RunOutcomesTest(unittest.TestCase):
|
||||
return Containers(InTurn(*runs), "bench", "go test ./...", 512, "1000:1000")
|
||||
|
||||
def bench(self, *runs: Ran | Failure) -> main.Bench:
|
||||
return main.Bench("", {"base": "b", "head": "h"}, self.trees, main.Asked(seed=1, bugs=1, runs=1), self.containers(*runs), self.folder, lambda *args, **given: "")
|
||||
return main.Bench("", {"base": "b", "head": "h"}, self.trees, main.Asked(seed=1, bugs=1, runs=1), self.containers(*runs), self.folder, lambda *args, **given: "", lambda line: None)
|
||||
|
||||
def test_a_fix_whose_tests_run_out_of_time_does_not_pass(self):
|
||||
late = TimedOut("docker run still ran after 30 min")
|
||||
@@ -659,5 +659,17 @@ class ApiProxyTest(unittest.IsolatedAsyncioTestCase):
|
||||
self.assertEqual(await self.answered(request), b"HTTP/1.1 403 Forbidden\r\nContent-Length: 0\r\n\r\n")
|
||||
|
||||
|
||||
class OnDisk(unittest.TestCase):
|
||||
def test_a_refused_file_operation_is_a_failure_that_says_what_could_not_be_done(self):
|
||||
with tempfile.TemporaryDirectory() as folder:
|
||||
missing = pathlib.Path(folder, "gone", "file")
|
||||
found = main.on_disk(f"read {missing}", missing.read_bytes)
|
||||
self.assertIsInstance(found, Failure)
|
||||
self.assertTrue(found.reason.startswith(f"could not read {missing}: "), found.reason)
|
||||
|
||||
def test_an_operation_that_succeeds_gives_its_answer(self):
|
||||
self.assertEqual(main.on_disk("count", lambda: 3), 3)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user