MCPcopy
hub / github.com/Textualize/textual / test_hover_update_styles

Function test_hover_update_styles

tests/test_app.py:37–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35
36
37async def test_hover_update_styles():
38 app = MyApp(ansi_color=False)
39 async with app.run_test() as pilot:
40 button = app.query_one(Button)
41 assert button.pseudo_classes == {
42 "blur",
43 "can-focus",
44 "dark",
45 "enabled",
46 "first-of-type",
47 "last-of-type",
48 "last-child",
49 "even",
50 "empty",
51 }
52
53 # Take note of the initial background colour
54 initial_background = button.styles.background
55 await pilot.hover(Button)
56
57 # We've hovered, so ensure the pseudoclass is present and background changed
58 assert button.pseudo_classes == {
59 "blur",
60 "can-focus",
61 "dark",
62 "enabled",
63 "hover",
64 "first-of-type",
65 "last-of-type",
66 "last-child",
67 "even",
68 "empty",
69 }
70 assert button.styles.background != initial_background
71
72
73def test_setting_title():

Callers

nothing calls this directly

Calls 4

run_testMethod · 0.80
query_oneMethod · 0.80
hoverMethod · 0.80
MyAppClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…