aboutsummaryrefslogtreecommitdiff
path: root/tests/test_text.py
diff options
context:
space:
mode:
authorThomas Touhey <thomas@touhey.fr>2019-05-10 11:53:55 +0200
committerThomas Touhey <thomas@touhey.fr>2019-05-10 11:53:55 +0200
commitaa910dfe205af86c5359002f452dac6d099ad08a (patch)
tree1f62068c0794a240549d070dc5390471a82c2633 /tests/test_text.py
parentd4c11d05f31c4e28c5af8988cf3e4d2b743de806 (diff)
Corrected CSS producing and added tests for it.
Diffstat (limited to 'tests/test_text.py')
-rwxr-xr-xtests/test_text.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_text.py b/tests/test_text.py
index eb3d5c3..c29bb25 100755
--- a/tests/test_text.py
+++ b/tests/test_text.py
@@ -45,4 +45,19 @@ def test_rgba(test_input, expected):
def test_hsla(test_input, expected):
assert Color.from_text(test_input).hsla() == expected
+@pytest.mark.parametrize('test_input,expected', (
+ ('blue',
+ ('#0000FF',)),
+ (' rgb (1,22, 242 , 50.0% )',
+ ('#0116F2', 'rgba(1, 22, 242, 50%)')),
+ ('darker(10%, hsl(0, 1, 50.0%))',
+ ('#CC0000', 'hsl(0deg, 100%, 40%)')),
+ ('hls(0 / 1 0.5 , 0.2)',
+ ('#FFFFFF', 'rgba(255, 255, 255, 20%)', 'hsla(0deg, 50%, 100%, 20%)')),
+ ('hbw(127 .5)',
+ ('#00800F', 'hwb(127deg, 0%, 50%)')),
+))
+def test_css(test_input, expected):
+ assert Color.from_text(test_input).css() == expected
+
# End of file.