Rework the basic Screen binding test

Rather than test that it has zero bindings (although that is a legitimate
test too), test for the thing we're really concerned about here: that it
doesn't have movement keys. That's what this is all about.
This commit is contained in:
Dave Pearson
2022-12-13 10:25:43 +00:00
parent 4a1a78819e
commit 3bb7a99a0a

View File

@@ -51,10 +51,10 @@ class AppWithScreenNoBindings(App[None]):
@pytest.mark.xfail(
reason="Screen is incorrectly starting with bindings for movement keys [issue#1343]"
)
async def test_app_screen_no_bindings() -> None:
"""An screen with no bindings should have no bindings."""
async def test_app_screen_has_no_movement_bindings() -> None:
"""A screen with no bindings should not have movement key bindings."""
async with AppWithScreenNoBindings().run_test() as pilot:
assert list(pilot.app.screen._bindings.keys.keys()) == []
assert list(pilot.app.screen._bindings.keys.keys()) != MOVEMENT_KEYS
##############################################################################