Example #1
0
 def test_transform_rgba(self):
     """
     Tests rgba() color transformation
     """
     color = "rgba(255, 0, 0, 1)"
     transformed = utils.transform_value(color)
     self.assertEqual(transformed, "rgba(76, 76, 76, 1.0)")
Example #2
0
 def test_transform_rgb(self):
     """
     Tests rgb() color transformation
     """
     color = "rgb(255, 0, 0)"
     transformed = utils.transform_value(color)
     self.assertEqual(transformed, "#4c4c4c")
Example #3
0
 def test_transform_hex_3(self):
     """
     Tests if normal hex (3 chars) will be transformed correctly
     """
     color = "#f00"
     transformed = utils.transform_value(color)
     self.assertEqual(transformed, "#4c4c4c")
Example #4
0
 def test_transform_other_named_color(self):
     """
     Tests if named color not included in utils.KWRD_MAP will be left unchanged
     """
     color = "color: brown;"
     transformed = utils.transform_value(color)
     self.assertEqual(transformed, color)
Example #5
0
 def test_transform_named_color_w_whitespaces(self):
     """
     Tests if named color with whitespaces will be transformed correctly
     """
     color = "color:               gray        ;"
     transformed = utils.transform_value(color)
     self.assertEqual(transformed, "color: #808080")
Example #6
0
 def test_transform_named_color(self):
     """
     Test for standard named color
     """
     color = "color: blue;"
     transformed = utils.transform_value(color)
     self.assertEqual(transformed, "color: #1d1d1d")