Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Mar 2, 2023
1 parent a0911fa commit 5544f62
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
14 changes: 8 additions & 6 deletions panel/tests/layout/test_accordion.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ def test_accordion_constructor(document, comm):
assert all(isinstance(c, Card) for c in model.children)
card1, card2 = model.children

assert card1.children[0].children[0].text == 'Div1'
assert card1.children[0].children[0].text == '<h3>Div1</h3>'
assert card1.children[1] is div1
assert card2.children[0].children[0].text == 'Div2'
assert card2.children[0].children[0].text == '<h3>Div2</h3>'
assert card2.children[1] is div2


Expand All @@ -69,9 +69,11 @@ def test_accordion_implicit_constructor(document, comm):
assert all(isinstance(c, Card) for c in model.children)
card1, card2 = model.children

assert card1.children[0].children[0].text == p1.name == 'Div1'
assert p1.name == 'Div1'
assert card1.children[0].children[0].text == '<h3>Div1</h3>'
assert card1.children[1] is div1
assert card2.children[0].children[0].text == p2.name == 'Div2'
assert p2.name == 'Div2'
assert card2.children[0].children[0].text == '<h3>Div2</h3>'
assert card2.children[1] is div2


Expand All @@ -88,9 +90,9 @@ def test_accordion_constructor_with_named_objects(document, comm):
assert all(isinstance(c, Card) for c in model.children)
card1, card2 = model.children

assert card1.children[0].children[0].text == 'Tab1'
assert card1.children[0].children[0].text == '<h3>Tab1</h3>'
assert card1.children[1] is div1
assert card2.children[0].children[0].text == 'Tab2'
assert card2.children[0].children[0].text == '<h3>Tab2</h3>'
assert card2.children[1] is div2


Expand Down
4 changes: 2 additions & 2 deletions panel/tests/layout/test_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ def test_card_get_root_title(document, comm):

assert isinstance(model, CardModel)
assert model.children == [header, div1, div2]
assert header.children[0].text == "Test"
assert header.children[0].text == '<h3>Test</h3>'

div3 = Div()
layout.header = div3
assert header.children[0] is div3

layout.header = None
assert header.children[0].text == "Test"
assert header.children[0].text == '<h3>Test</h3>'


def test_card_get_root_header(document, comm):
Expand Down

0 comments on commit 5544f62

Please sign in to comment.