Unit test for Styles.css

This commit is contained in:
Darren Burns
2022-10-07 14:38:02 +01:00
parent 2784370ba1
commit 72dff52212

View File

@@ -123,6 +123,18 @@ def test_get_opacity_default():
assert styles.text_opacity == 1.0 assert styles.text_opacity == 1.0
def test_styles_css_property():
css = "opacity: 50%; text-opacity: 20%; background: green; color: red; tint: dodgerblue 20%;"
styles = Styles().parse(css, path="")
assert styles.css == (
"background: #008000;\n"
"color: #FF0000;\n"
"opacity: 0.5;\n"
"text-opacity: 0.2;\n"
"tint: rgba(30,144,255,0.2);"
)
@pytest.mark.parametrize( @pytest.mark.parametrize(
"set_value, expected", "set_value, expected",
[ [