mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
26 lines
602 B
Python
26 lines
602 B
Python
import pytest
|
|
|
|
from textual.css.errors import StyleValueError
|
|
from textual.dom import DOMNode
|
|
|
|
|
|
def test_display_default():
|
|
node = DOMNode()
|
|
assert node.display is True
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
"setter_value,style_value",
|
|
[[True, "block"], [False, "none"], ["block", "block"], ["none", "none"]],
|
|
)
|
|
def test_display_set_bool(setter_value, style_value):
|
|
node = DOMNode()
|
|
node.display = setter_value
|
|
assert node.styles.display == style_value
|
|
|
|
|
|
def test_display_set_invalid_value():
|
|
node = DOMNode()
|
|
with pytest.raises(StyleValueError):
|
|
node.display = "blah"
|