Exemplo n.º 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])
Exemplo n.º 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"])
Exemplo n.º 3
0
 def test_not_valid_color_tuple_2_channels(self, setting_info):
     with pytest.raises(ValueError):
         rgbcolor.process_value(setting_info, [0xFF, 0x18])
Exemplo n.º 4
0
 def test_valid_color_tuple(self, setting_info, color):
     bytes_ = rgbcolor.process_value(setting_info, color)
     assert bytes_ == [0xFF, 0x18, 0x00]
Exemplo n.º 5
0
 def test_not_valid_color_string(self, setting_info):
     with pytest.raises(ValueError):
         rgbcolor.process_value(setting_info, "hello")
Exemplo n.º 6
0
 def test_named_colors(self, setting_info, color, result):
     bytes_ = rgbcolor.process_value(setting_info, color)
     assert bytes_ == result
Exemplo n.º 7
0
 def test_valid_color_hex_string(self, setting_info, color):
     bytes_ = rgbcolor.process_value(setting_info, color)
     assert bytes_ == [0xFF, 0x22, 0x00]