mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Reformat to keep black happy
This commit is contained in:
@@ -1,27 +1,32 @@
|
|||||||
from textual.app import App
|
from textual.app import App
|
||||||
|
|
||||||
|
|
||||||
class OnLoadDarkSwitch(App[None]):
|
class OnLoadDarkSwitch(App[None]):
|
||||||
"""App for testing toggling dark mode in on_load."""
|
"""App for testing toggling dark mode in on_load."""
|
||||||
|
|
||||||
def on_load(self) -> None:
|
def on_load(self) -> None:
|
||||||
self.dark = not self.dark
|
self.dark = not self.dark
|
||||||
|
|
||||||
|
|
||||||
async def test_toggle_dark_on_load() -> None:
|
async def test_toggle_dark_on_load() -> None:
|
||||||
"""It should be possible to toggle dark mode in on_load."""
|
"""It should be possible to toggle dark mode in on_load."""
|
||||||
async with OnLoadDarkSwitch().run_test() as pilot:
|
async with OnLoadDarkSwitch().run_test() as pilot:
|
||||||
assert not pilot.app.dark
|
assert not pilot.app.dark
|
||||||
|
|
||||||
|
|
||||||
class OnMountDarkSwitch(App[None]):
|
class OnMountDarkSwitch(App[None]):
|
||||||
"""App for testing toggling dark mode in on_mount."""
|
"""App for testing toggling dark mode in on_mount."""
|
||||||
|
|
||||||
def on_mount(self) -> None:
|
def on_mount(self) -> None:
|
||||||
self.dark = not self.dark
|
self.dark = not self.dark
|
||||||
|
|
||||||
|
|
||||||
async def test_toggle_dark_on_mount() -> None:
|
async def test_toggle_dark_on_mount() -> None:
|
||||||
"""It should be possible to toggle dark mode in on_mount."""
|
"""It should be possible to toggle dark mode in on_mount."""
|
||||||
async with OnMountDarkSwitch().run_test() as pilot:
|
async with OnMountDarkSwitch().run_test() as pilot:
|
||||||
assert not pilot.app.dark
|
assert not pilot.app.dark
|
||||||
|
|
||||||
|
|
||||||
class ActionDarkSwitch(App[None]):
|
class ActionDarkSwitch(App[None]):
|
||||||
"""App for testing toggling dark mode from an action."""
|
"""App for testing toggling dark mode from an action."""
|
||||||
|
|
||||||
@@ -30,6 +35,7 @@ class ActionDarkSwitch(App[None]):
|
|||||||
def action_toggle(self) -> None:
|
def action_toggle(self) -> None:
|
||||||
self.dark = not self.dark
|
self.dark = not self.dark
|
||||||
|
|
||||||
|
|
||||||
async def test_toggle_dark_in_action() -> None:
|
async def test_toggle_dark_in_action() -> None:
|
||||||
"""It should be possible to toggle dark mode with an action."""
|
"""It should be possible to toggle dark mode with an action."""
|
||||||
async with OnMountDarkSwitch().run_test() as pilot:
|
async with OnMountDarkSwitch().run_test() as pilot:
|
||||||
|
|||||||
Reference in New Issue
Block a user