mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
assert animation frame called
This commit is contained in:
@@ -175,6 +175,7 @@ class TestAnimator(Animator):
|
|||||||
def __init__(self, *args) -> None:
|
def __init__(self, *args) -> None:
|
||||||
super().__init__(*args)
|
super().__init__(*args)
|
||||||
self._time = 0.0
|
self._time = 0.0
|
||||||
|
self._on_animation_frame_called = False
|
||||||
|
|
||||||
def get_time(self):
|
def get_time(self):
|
||||||
return self._time
|
return self._time
|
||||||
@@ -203,9 +204,11 @@ def test_animator():
|
|||||||
easing=EASING[DEFAULT_EASING],
|
easing=EASING[DEFAULT_EASING],
|
||||||
)
|
)
|
||||||
assert animator._animations[(id(animate_test), "foo")] == expected
|
assert animator._animations[(id(animate_test), "foo")] == expected
|
||||||
|
assert not animator._on_animation_frame_called
|
||||||
|
|
||||||
animator()
|
animator()
|
||||||
assert animate_test.foo == 0
|
assert animate_test.foo == 0
|
||||||
|
assert animator._on_animation_frame_called
|
||||||
|
|
||||||
animator._time = 5
|
animator._time = 5
|
||||||
animator()
|
animator()
|
||||||
|
|||||||
Reference in New Issue
Block a user