Skip to content

Commit 41db1b0

Browse files
Fix failing unit tests
1 parent f74838b commit 41db1b0

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

tests/test_graphical_imu_calibration.py

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def setUp(self):
3737
if sys.platform == "esp32":
3838
self.screenshot_dir = "tests/screenshots"
3939
else:
40-
self.screenshot_dir = "/home/user/MicroPythonOS/tests/screenshots"
40+
self.screenshot_dir = "../tests/screenshots" # it runs from internal_filesystem/
4141

4242
# Ensure directory exists
4343
try:
@@ -79,22 +79,12 @@ def test_check_calibration_activity_loads(self):
7979
simulate_click(coords['center_x'], coords['center_y'])
8080
wait_for_render(30)
8181

82-
# Verify CheckIMUCalibrationActivity loaded
83-
screen = lv.screen_active()
84-
self.assertTrue(verify_text_present(screen, "IMU Calibration Check"),
85-
"CheckIMUCalibrationActivity title not found")
86-
87-
# Wait for real-time updates to populate
88-
wait_for_render(20)
89-
9082
# Verify key elements are present
83+
screen = lv.screen_active()
9184
print_screen_labels(screen)
92-
self.assertTrue(verify_text_present(screen, "Quality:"),
93-
"Quality label not found")
94-
self.assertTrue(verify_text_present(screen, "Accelerometer"),
95-
"Accelerometer label not found")
96-
self.assertTrue(verify_text_present(screen, "Gyroscope"),
97-
"Gyroscope label not found")
85+
self.assertTrue(verify_text_present(screen, "Quality:"), "Quality label not found")
86+
self.assertTrue(verify_text_present(screen, "Accel."), "Accel. label not found")
87+
self.assertTrue(verify_text_present(screen, "Gyro"), "Gyro label not found")
9888

9989
# Capture screenshot
10090
screenshot_path = f"{self.screenshot_dir}/check_imu_calibration.raw"
@@ -191,8 +181,7 @@ def test_navigation_from_check_to_calibrate(self):
191181

192182
# Verify Check activity loaded
193183
screen = lv.screen_active()
194-
self.assertTrue(verify_text_present(screen, "IMU Calibration Check"),
195-
"Check activity did not load")
184+
self.assertTrue(verify_text_present(screen, "on flat surface"), "Check activity did not load")
196185

197186
# Click "Calibrate" button to navigate to Calibrate activity
198187
calibrate_btn = find_button_with_text(screen, "Calibrate")

0 commit comments

Comments
 (0)