Add tests for placeholder widget.

This commit is contained in:
Rodrigo Girão Serrão
2022-11-18 15:14:56 +00:00
parent 21630e07fc
commit a87c9ca916
4 changed files with 207 additions and 14 deletions

15
tests/test_placeholder.py Normal file
View File

@@ -0,0 +1,15 @@
import pytest
from textual.widgets import Placeholder
from textual.widgets._placeholder import InvalidPlaceholderVariant
def test_invalid_placeholder_variant():
with pytest.raises(InvalidPlaceholderVariant):
Placeholder("this is clearly not a valid variant!")
def test_invalid_reactive_variant_change():
p = Placeholder()
with pytest.raises(InvalidPlaceholderVariant):
p.variant = "this is clearly not a valid variant!"