mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Add snapshot test for hot reloading.
This commit is contained in:
28
tests/snapshot_tests/snapshot_apps/hot_reloading_app.py
Normal file
28
tests/snapshot_tests/snapshot_apps/hot_reloading_app.py
Normal file
@@ -0,0 +1,28 @@
|
||||
from pathlib import Path
|
||||
|
||||
from textual.app import App, ComposeResult
|
||||
from textual.containers import Container
|
||||
from textual.widgets import Label
|
||||
|
||||
|
||||
CSS_PATH = (Path(__file__) / "../hot_reloading_app.css").resolve()
|
||||
|
||||
CSS_PATH.write_text(
|
||||
"""
|
||||
Container {
|
||||
align: center middle;
|
||||
}
|
||||
|
||||
Label {
|
||||
border: round $primary;
|
||||
padding: 3;
|
||||
}
|
||||
"""
|
||||
)
|
||||
|
||||
|
||||
class HotReloadingApp(App[None]):
|
||||
CSS_PATH = CSS_PATH
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
yield Container(Label("Hello, world!"))
|
||||
Reference in New Issue
Block a user