Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Jul 29, 2024
1 parent 3937cf0 commit 74525b5
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion panel/tests/widgets/test_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ def test_literal_input(document, comm):
with pytest.raises(ValueError):
literal.value = []


def test_static_text(document, comm):

text = StaticText(value='ABC', name='Text:')
Expand All @@ -244,6 +243,31 @@ def test_static_text(document, comm):
text.value = '<b>Text:</b>: ABC'
assert widget.text == '<b>Text:</b>: ABC'

def test_static_text_no_sync(document, comm):
text = StaticText(value='ABC', name='Text:')

widget = text.get_root(document, comm=comm)

widget.text = 'CBA'
assert text.value == 'ABC'

def test_static_text_empty(document, comm):

text = StaticText(name='Text:')

widget = text.get_root(document, comm=comm)

assert widget.text == '<b>Text:</b>: '

def test_static_text_repr(document, comm):

text = StaticText(value=StaticText, name='Text:')

widget = text.get_root(document, comm=comm)

assert widget.text == '<b>Text:</b>: &lt;class &#x27;panel.widgets.input.StaticText&#x27;&gt;'



def test_text_input(document, comm):

Expand Down

0 comments on commit 74525b5

Please sign in to comment.