Skip to content

Commit b54dbfe

Browse files
Simplify test
1 parent 514ce6f commit b54dbfe

1 file changed

Lines changed: 3 additions & 21 deletions

File tree

tests/test_graphical_notification_bar.py

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class TestNotificationBarVisibility(unittest.TestCase):
2525
def setUp(self):
2626
AppManager.start_app("com.micropythonos.launcher")
2727
topmenu.open_bar()
28-
wait_for_render(iterations=40)
28+
wait_for_render(iterations=20)
2929
self._wait_for_bar_visible()
3030

3131
def _wait_for_bar_visible(self, timeout_ms=4000):
@@ -37,21 +37,6 @@ def _wait_for_bar_visible(self, timeout_ms=4000):
3737
if bar_coords and bar_coords["y1"] >= -1:
3838
return True
3939
wait_for_render(iterations=10)
40-
bar = topmenu.notification_bar
41-
if bar is not None:
42-
bar.set_y(0)
43-
wait_for_render(iterations=60)
44-
bar_coords = get_widget_coords(bar)
45-
return bool(bar_coords and bar_coords["y1"] >= -1)
46-
47-
def _wait_for_bar_height(self, bar, timeout_ms=4000):
48-
start = time.ticks_ms()
49-
expected_height = AppearanceManager.NOTIFICATION_BAR_HEIGHT - 1
50-
while time.ticks_diff(time.ticks_ms(), start) < timeout_ms:
51-
coords = get_widget_coords(bar)
52-
if coords and coords["height"] >= expected_height:
53-
return True
54-
wait_for_render(iterations=10)
5540
return False
5641

5742
def _get_bar_labels(self, bar):
@@ -167,13 +152,10 @@ def test_notification_bar_widgets_visible(self):
167152
bar = topmenu.notification_bar
168153
self.assertIsNotNone(bar, "Notification bar was not created")
169154

170-
wait_for_render(iterations=30)
155+
wait_for_render(iterations=20)
171156
if not self._wait_for_bar_visible():
172157
topmenu.open_bar()
173-
wait_for_render(iterations=60)
174-
if bar is not None:
175-
bar.set_y(0)
176-
wait_for_render(iterations=30)
158+
wait_for_render(iterations=40)
177159
bar_coords = get_widget_coords(bar)
178160
self.assertIsNotNone(bar_coords, "Notification bar coords not available")
179161
self.assertTrue(topmenu.bar_open, "Notification bar was not marked open")

0 commit comments

Comments
 (0)