From 4418108748ff0f2b4c55fbcc22327a0f66f3f717 Mon Sep 17 00:00:00 2001 From: Saleh Alghusson Date: Tue, 26 Nov 2024 16:52:59 -0500 Subject: [PATCH] Update2.txt does not exist after rollback As mentioned in this issue (https://github.com/PaulLockett/CodeSignal_Practice_Industry_Coding_Framework/issues/8). I think there is a bug in the test file for level 4. This is the order of operations: ["FILE_UPLOAD_AT", "2021-07-01T12:00:00", "Initial.txt", "100kb"], ["FILE_UPLOAD_AT", "2021-07-01T12:05:00", "Update1.txt", "150kb", 3600], ["FILE_GET_AT", "2021-07-01T12:10:00", "Initial.txt"], ["FILE_COPY_AT", "2021-07-01T12:15:00", "Update1.txt", "Update1Copy.txt"], ["FILE_UPLOAD_AT", "2021-07-01T12:20:00", "Update2.txt", "200kb", 1800], ["ROLLBACK", "2021-07-01T12:10:00"], ["FILE_GET_AT", "2021-07-01T12:25:00", "Update1.txt"], ["FILE_GET_AT", "2021-07-01T12:25:00", "Initial.txt"], ["FILE_SEARCH_AT", "2021-07-01T12:25:00", "Up"], ["FILE_GET_AT", "2021-07-01T12:25:00", "Update2.txt"] --- practice_assessments/file_storage/test_simulation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/practice_assessments/file_storage/test_simulation.py b/practice_assessments/file_storage/test_simulation.py index 0862744..172ac7b 100644 --- a/practice_assessments/file_storage/test_simulation.py +++ b/practice_assessments/file_storage/test_simulation.py @@ -51,7 +51,7 @@ def test_group_3(self): def test_group_4(self): output = simulate_coding_framework(self.test_data_4) - self.assertEqual(output, ["uploaded at Initial.txt", "uploaded at Update1.txt", "got at Initial.txt", "copied at Update1.txt to Update1Copy.txt", "uploaded at Update2.txt", "rollback to 2021-07-01T12:10:00", "got at Update1.txt", "got at Initial.txt", "found at [Update1.txt, Update1Copy.txt, Update2.txt]", "got at Update2.txt"]) + self.assertEqual(output, ["uploaded at Initial.txt", "uploaded at Update1.txt", "got at Initial.txt", "copied at Update1.txt to Update1Copy.txt", "uploaded at Update2.txt", "rollback to 2021-07-01T12:10:00", "got at Update1.txt", "got at Initial.txt", "found at [Update1.txt, Update1Copy.txt]", "file not found"]) if __name__ == '__main__': unittest.main()