Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mosquito committed Sep 17, 2023
1 parent 666dcdc commit 303a907
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions tests/test_html.py
Expand Up @@ -83,16 +83,22 @@ def test_tag_features():


def test_style():
assert str(Style(text_align="center", padding=0)) == 'padding: "0"; text-align: "center";'
assert str(Style(text_align="center", padding=0)) == 'padding: 0; text-align: center;'

style = Style()
assert str(style) == ''

style['padding'] = 0
assert str(style) == "padding: \"0\";"
assert str(style) == "padding: 0;"

style['margin'] = 0
assert str(style) == 'margin: "0"; padding: "0";'
assert str(style) == 'margin: 0; padding: 0;'

assert str(
html.div("red", style=Style(color="#ff0000"))
) == (
'<div style="color: #ff0000;">red</div>'
)


def test_stylesheet():
Expand All @@ -101,6 +107,6 @@ def test_stylesheet():
style_sheet[('div', 'a', 'table')] = Style(background_color="#111111", color="#cccccc")

assert str(style_sheet) == (
'body {background-color: "#000000"; color: "#ffffff";}\n'
'div, a, table {background-color: "#111111"; color: "#cccccc";}'
'body {background-color: #000000; color: #ffffff;}\n'
'div, a, table {background-color: #111111; color: #cccccc;}'
)

0 comments on commit 303a907

Please sign in to comment.