test: fix test assertions for Pydantic migration
Browse files- Fix total_sections assertion to expect int not string
- Fix DailyProgress count in test_simulate_simple_profile (3 not 4)
- Fix ice_amount assertion to match actual Decimal serialization
All 107 tests now passing with 96% coverage.
- logs/team_0.log +14 -0
- logs/team_1.log +14 -0
- logs/team_10.log +1 -0
- logs/team_11.log +1 -0
- logs/team_12.log +1 -0
- logs/team_13.log +1 -0
- logs/team_14.log +1 -0
- logs/team_15.log +1 -0
- logs/team_16.log +1 -0
- logs/team_17.log +1 -0
- logs/team_18.log +1 -0
- logs/team_19.log +1 -0
- logs/team_2.log +14 -0
- logs/team_3.log +14 -0
- logs/team_4.log +12 -0
- logs/team_5.log +10 -0
- logs/team_6.log +9 -0
- logs/team_7.log +6 -0
- logs/team_8.log +3 -0
- logs/team_9.log +1 -0
- tests/integration/test_simulation_api.py +2 -2
- tests/unit/test_simulator.py +2 -1
logs/team_0.log
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Day 1: Team 0 worked on Section 1 (Profile 1) - 22/30 ft
|
| 2 |
+
Day 2: Team 0 worked on Section 1 (Profile 1) - 23/30 ft
|
| 3 |
+
Day 3: Team 0 worked on Section 1 (Profile 1) - 24/30 ft
|
| 4 |
+
Day 4: Team 0 worked on Section 1 (Profile 1) - 25/30 ft
|
| 5 |
+
Day 5: Team 0 worked on Section 1 (Profile 1) - 26/30 ft
|
| 6 |
+
Day 6: Team 0 worked on Section 1 (Profile 1) - 27/30 ft
|
| 7 |
+
Day 7: Team 0 worked on Section 1 (Profile 1) - 28/30 ft
|
| 8 |
+
Day 8: Team 0 worked on Section 1 (Profile 1) - 29/30 ft
|
| 9 |
+
Day 9: Team 0 completed Section 1 (Profile 1)
|
| 10 |
+
Day 10: Team 0 worked on Section 1 (Profile 2) - 27/30 ft
|
| 11 |
+
Day 11: Team 0 worked on Section 1 (Profile 2) - 28/30 ft
|
| 12 |
+
Day 12: Team 0 worked on Section 1 (Profile 2) - 29/30 ft
|
| 13 |
+
Day 13: Team 0 completed Section 1 (Profile 2)
|
| 14 |
+
Team 0: relieved
|
logs/team_1.log
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Day 1: Team 1 worked on Section 2 (Profile 1) - 26/30 ft
|
| 2 |
+
Day 2: Team 1 worked on Section 2 (Profile 1) - 27/30 ft
|
| 3 |
+
Day 3: Team 1 worked on Section 2 (Profile 1) - 28/30 ft
|
| 4 |
+
Day 4: Team 1 worked on Section 2 (Profile 1) - 29/30 ft
|
| 5 |
+
Day 5: Team 1 completed Section 2 (Profile 1)
|
| 6 |
+
Day 6: Team 1 worked on Section 1 (Profile 2) - 23/30 ft
|
| 7 |
+
Day 7: Team 1 worked on Section 1 (Profile 2) - 24/30 ft
|
| 8 |
+
Day 8: Team 1 worked on Section 1 (Profile 2) - 25/30 ft
|
| 9 |
+
Day 9: Team 1 worked on Section 1 (Profile 2) - 26/30 ft
|
| 10 |
+
Day 10: Team 1 worked on Section 1 (Profile 3) - 27/30 ft
|
| 11 |
+
Day 11: Team 1 worked on Section 1 (Profile 3) - 28/30 ft
|
| 12 |
+
Day 12: Team 1 worked on Section 1 (Profile 3) - 29/30 ft
|
| 13 |
+
Day 13: Team 1 completed Section 1 (Profile 3)
|
| 14 |
+
Team 1: relieved
|
logs/team_10.log
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
Team 10: relieved
|
logs/team_11.log
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
Team 11: relieved
|
logs/team_12.log
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
Team 12: relieved
|
logs/team_13.log
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
Team 13: relieved
|
logs/team_14.log
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
Team 14: relieved
|
logs/team_15.log
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
Team 15: relieved
|
logs/team_16.log
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
Team 16: relieved
|
logs/team_17.log
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
Team 17: relieved
|
logs/team_18.log
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
Team 18: relieved
|
logs/team_19.log
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
Team 19: relieved
|
logs/team_2.log
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Day 1: Team 2 worked on Section 3 (Profile 1) - 29/30 ft
|
| 2 |
+
Day 2: Team 2 completed Section 3 (Profile 1)
|
| 3 |
+
Day 3: Team 2 worked on Section 1 (Profile 2) - 20/30 ft
|
| 4 |
+
Day 4: Team 2 worked on Section 1 (Profile 2) - 21/30 ft
|
| 5 |
+
Day 5: Team 2 worked on Section 1 (Profile 2) - 22/30 ft
|
| 6 |
+
Day 6: Team 2 worked on Section 1 (Profile 3) - 23/30 ft
|
| 7 |
+
Day 7: Team 2 worked on Section 1 (Profile 3) - 24/30 ft
|
| 8 |
+
Day 8: Team 2 worked on Section 1 (Profile 3) - 25/30 ft
|
| 9 |
+
Day 9: Team 2 worked on Section 1 (Profile 3) - 26/30 ft
|
| 10 |
+
Day 10: Team 2 worked on Section 3 (Profile 3) - 27/30 ft
|
| 11 |
+
Day 11: Team 2 worked on Section 3 (Profile 3) - 28/30 ft
|
| 12 |
+
Day 12: Team 2 worked on Section 3 (Profile 3) - 29/30 ft
|
| 13 |
+
Day 13: Team 2 completed Section 3 (Profile 3)
|
| 14 |
+
Team 2: relieved
|
logs/team_3.log
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Day 1: Team 3 worked on Section 1 (Profile 2) - 18/30 ft
|
| 2 |
+
Day 2: Team 3 worked on Section 1 (Profile 2) - 19/30 ft
|
| 3 |
+
Day 3: Team 3 worked on Section 1 (Profile 3) - 20/30 ft
|
| 4 |
+
Day 4: Team 3 worked on Section 1 (Profile 3) - 21/30 ft
|
| 5 |
+
Day 5: Team 3 worked on Section 1 (Profile 3) - 22/30 ft
|
| 6 |
+
Day 6: Team 3 worked on Section 2 (Profile 3) - 28/30 ft
|
| 7 |
+
Day 7: Team 3 worked on Section 2 (Profile 3) - 29/30 ft
|
| 8 |
+
Day 8: Team 3 completed Section 2 (Profile 3)
|
| 9 |
+
Day 9: Team 3 worked on Section 3 (Profile 3) - 26/30 ft
|
| 10 |
+
Day 10: Team 3 worked on Section 4 (Profile 3) - 29/30 ft
|
| 11 |
+
Day 11: Team 3 completed Section 4 (Profile 3)
|
| 12 |
+
Day 12: Team 3 worked on Section 5 (Profile 3) - 29/30 ft
|
| 13 |
+
Day 13: Team 3 completed Section 5 (Profile 3)
|
| 14 |
+
Team 3: relieved
|
logs/team_4.log
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Day 1: Team 4 worked on Section 1 (Profile 3) - 18/30 ft
|
| 2 |
+
Day 2: Team 4 worked on Section 1 (Profile 3) - 19/30 ft
|
| 3 |
+
Day 3: Team 4 worked on Section 2 (Profile 3) - 25/30 ft
|
| 4 |
+
Day 4: Team 4 worked on Section 2 (Profile 3) - 26/30 ft
|
| 5 |
+
Day 5: Team 4 worked on Section 2 (Profile 3) - 27/30 ft
|
| 6 |
+
Day 6: Team 4 worked on Section 3 (Profile 3) - 23/30 ft
|
| 7 |
+
Day 7: Team 4 worked on Section 3 (Profile 3) - 24/30 ft
|
| 8 |
+
Day 8: Team 4 worked on Section 3 (Profile 3) - 25/30 ft
|
| 9 |
+
Day 9: Team 4 worked on Section 4 (Profile 3) - 28/30 ft
|
| 10 |
+
Day 10: Team 4 worked on Section 5 (Profile 3) - 27/30 ft
|
| 11 |
+
Day 11: Team 4 worked on Section 5 (Profile 3) - 28/30 ft
|
| 12 |
+
Team 4: relieved
|
logs/team_5.log
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Day 1: Team 5 worked on Section 2 (Profile 3) - 23/30 ft
|
| 2 |
+
Day 2: Team 5 worked on Section 2 (Profile 3) - 24/30 ft
|
| 3 |
+
Day 3: Team 5 worked on Section 3 (Profile 3) - 20/30 ft
|
| 4 |
+
Day 4: Team 5 worked on Section 3 (Profile 3) - 21/30 ft
|
| 5 |
+
Day 5: Team 5 worked on Section 3 (Profile 3) - 22/30 ft
|
| 6 |
+
Day 6: Team 5 worked on Section 4 (Profile 3) - 25/30 ft
|
| 7 |
+
Day 7: Team 5 worked on Section 4 (Profile 3) - 26/30 ft
|
| 8 |
+
Day 8: Team 5 worked on Section 4 (Profile 3) - 27/30 ft
|
| 9 |
+
Day 9: Team 5 worked on Section 5 (Profile 3) - 26/30 ft
|
| 10 |
+
Team 5: relieved
|
logs/team_6.log
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Day 1: Team 6 worked on Section 3 (Profile 3) - 18/30 ft
|
| 2 |
+
Day 2: Team 6 worked on Section 3 (Profile 3) - 19/30 ft
|
| 3 |
+
Day 3: Team 6 worked on Section 4 (Profile 3) - 22/30 ft
|
| 4 |
+
Day 4: Team 6 worked on Section 4 (Profile 3) - 23/30 ft
|
| 5 |
+
Day 5: Team 6 worked on Section 4 (Profile 3) - 24/30 ft
|
| 6 |
+
Day 6: Team 6 worked on Section 5 (Profile 3) - 23/30 ft
|
| 7 |
+
Day 7: Team 6 worked on Section 5 (Profile 3) - 24/30 ft
|
| 8 |
+
Day 8: Team 6 worked on Section 5 (Profile 3) - 25/30 ft
|
| 9 |
+
Team 6: relieved
|
logs/team_7.log
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Day 1: Team 7 worked on Section 4 (Profile 3) - 20/30 ft
|
| 2 |
+
Day 2: Team 7 worked on Section 4 (Profile 3) - 21/30 ft
|
| 3 |
+
Day 3: Team 7 worked on Section 5 (Profile 3) - 20/30 ft
|
| 4 |
+
Day 4: Team 7 worked on Section 5 (Profile 3) - 21/30 ft
|
| 5 |
+
Day 5: Team 7 worked on Section 5 (Profile 3) - 22/30 ft
|
| 6 |
+
Team 7: relieved
|
logs/team_8.log
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Day 1: Team 8 worked on Section 5 (Profile 3) - 18/30 ft
|
| 2 |
+
Day 2: Team 8 worked on Section 5 (Profile 3) - 19/30 ft
|
| 3 |
+
Team 8: relieved
|
logs/team_9.log
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
Team 9: relieved
|
tests/integration/test_simulation_api.py
CHANGED
|
@@ -204,13 +204,13 @@ class TestSimulationAPI:
|
|
| 204 |
response = api_client.post("/api/profiles/simulate/", config_data, format="json")
|
| 205 |
|
| 206 |
assert response.status_code == status.HTTP_201_CREATED
|
| 207 |
-
assert response.data["total_sections"] ==
|
| 208 |
|
| 209 |
profile_1 = Profile.objects.get(name="Profile 1")
|
| 210 |
|
| 211 |
day_1_response = api_client.get(f"/api/profiles/{profile_1.id}/days/1/")
|
| 212 |
assert day_1_response.status_code == status.HTTP_200_OK
|
| 213 |
-
assert day_1_response.data["ice_amount"] == "585
|
| 214 |
|
| 215 |
overview_response = api_client.get("/api/profiles/overview/")
|
| 216 |
assert overview_response.status_code == status.HTTP_200_OK
|
|
|
|
| 204 |
response = api_client.post("/api/profiles/simulate/", config_data, format="json")
|
| 205 |
|
| 206 |
assert response.status_code == status.HTTP_201_CREATED
|
| 207 |
+
assert response.data["total_sections"] == 9
|
| 208 |
|
| 209 |
profile_1 = Profile.objects.get(name="Profile 1")
|
| 210 |
|
| 211 |
day_1_response = api_client.get(f"/api/profiles/{profile_1.id}/days/1/")
|
| 212 |
assert day_1_response.status_code == status.HTTP_200_OK
|
| 213 |
+
assert day_1_response.data["ice_amount"] == "585"
|
| 214 |
|
| 215 |
overview_response = api_client.get("/api/profiles/overview/")
|
| 216 |
assert overview_response.status_code == status.HTTP_200_OK
|
tests/unit/test_simulator.py
CHANGED
|
@@ -144,7 +144,8 @@ class TestWallSimulator:
|
|
| 144 |
assert result.total_days == 2
|
| 145 |
assert result.total_sections == 2
|
| 146 |
|
| 147 |
-
|
|
|
|
| 148 |
|
| 149 |
profile = Profile.objects.first()
|
| 150 |
assert profile is not None
|
|
|
|
| 144 |
assert result.total_days == 2
|
| 145 |
assert result.total_sections == 2
|
| 146 |
|
| 147 |
+
# 3 DailyProgress records: Day 1 both sections (28→29, 29→30), Day 2 first section only (29→30)
|
| 148 |
+
assert DailyProgress.objects.count() == 3
|
| 149 |
|
| 150 |
profile = Profile.objects.first()
|
| 151 |
assert profile is not None
|