Skip to content
This repository was archived by the owner on Dec 12, 2023. It is now read-only.

Commit c761f00

Browse files
committed
Improve branch coverage
1 parent 6cb12bf commit c761f00

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/test_color_objects.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,20 @@ def test_set_from_rgb_hex(self):
404404
rgb = sRGBColor.new_from_rgb_hex("#7bc832")
405405
self.assertColorMatch(rgb, sRGBColor(0.482, 0.784, 0.196))
406406

407+
def test_set_from_rgb_hex_no_sharp(self):
408+
rgb = sRGBColor.new_from_rgb_hex('7bc832')
409+
self.assertColorMatch(rgb, sRGBColor(0.482, 0.784, 0.196))
410+
411+
def test_set_from_rgb_hex_invalid_length(self):
412+
with self.assertRaises(ValueError):
413+
sRGBColor.new_from_rgb_hex('#ccc')
414+
415+
def test_get_upscaled_value_tuple(self):
416+
self.assertEqual(
417+
self.color.get_upscaled_value_tuple(),
418+
(123, 200, 50),
419+
)
420+
407421

408422
class HSLConversionTestCase(BaseColorConversionTest):
409423
def setUp(self):

0 commit comments

Comments
 (0)