File: test_placeholder.py

package info (click to toggle)
textual 2.1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 55,084 kB
  • sloc: python: 85,423; lisp: 1,669; makefile: 101
file content (15 lines) | stat: -rw-r--r-- 461 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import pytest

from textual.widgets import Placeholder
from textual.widgets._placeholder import InvalidPlaceholderVariant


def test_invalid_placeholder_variant():
    with pytest.raises(InvalidPlaceholderVariant):
        Placeholder(variant="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!"