From 140c4bf995edc6a651d5ec7af9bbb3292c70bad4 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Thu, 26 Jun 2025 06:25:50 +0200 Subject: test: add tests for ThreadColor initialization --- tests/test_threads_color.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/test_threads_color.py (limited to 'tests') diff --git a/tests/test_threads_color.py b/tests/test_threads_color.py new file mode 100644 index 00000000..a5442359 --- /dev/null +++ b/tests/test_threads_color.py @@ -0,0 +1,16 @@ +from lib.threads.color import ThreadColor + + +def test_init_color_from_string_rgb(): + color = ThreadColor("rgb(170, 187, 204)") + assert color.rgb == (170, 187, 204) + + +def test_init_color_from_string_hex(): + color = ThreadColor("#AABBCC") + assert color.rgb == (170, 187, 204) + + +def test_init_color_from_string_hex_icc(): + color = ThreadColor("#AABBCC icc-color(Some-Profile, 0.1, 0.2, 0.3, 0.4)") + assert color.rgb == (170, 187, 204) -- cgit v1.2.3