Skip to content

Commit b5e5118

Browse files
committed
static tests
1 parent e526daf commit b5e5118

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/test_static.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from textual.content import Content
2+
from textual.widgets import Static
3+
4+
5+
def test_content_property():
6+
static = Static()
7+
assert static.content == ""
8+
static.content = "Foo"
9+
assert static.content == "Foo"
10+
assert isinstance(static.content, str)
11+
assert static.visual == "Foo"
12+
assert isinstance(static.visual, Content)
13+
14+
static.update("Hello")
15+
assert static.content == "Hello"
16+
assert isinstance(static.content, str)
17+
assert static.visual == "Hello"
18+
assert isinstance(static.visual, Content)

0 commit comments

Comments
 (0)