Example #1
0
 def test_not_valid_color_tuple_wrong_range(self, setting_info):
     with pytest.raises(ValueError):
         rgbcolor.process_value(setting_info, [-1, 256, 1337])
Example #2
0
 def test_not_valid_color_ints_wrong_type(self, setting_info):
     with pytest.raises(ValueError):
         rgbcolor.process_value(setting_info, ["ff", "18", "00"])
Example #3
0
 def test_not_valid_color_tuple_2_channels(self, setting_info):
     with pytest.raises(ValueError):
         rgbcolor.process_value(setting_info, [0xFF, 0x18])
Example #4
0
 def test_valid_color_tuple(self, setting_info, color):
     bytes_ = rgbcolor.process_value(setting_info, color)
     assert bytes_ == [0xFF, 0x18, 0x00]
Example #5
0
 def test_not_valid_color_string(self, setting_info):
     with pytest.raises(ValueError):
         rgbcolor.process_value(setting_info, "hello")
Example #6
0
 def test_named_colors(self, setting_info, color, result):
     bytes_ = rgbcolor.process_value(setting_info, color)
     assert bytes_ == result
Example #7
0
 def test_valid_color_hex_string(self, setting_info, color):
     bytes_ = rgbcolor.process_value(setting_info, color)
     assert bytes_ == [0xFF, 0x22, 0x00]