示例#1
0
 def test_add_existing(self):
     components_color = [0x640000]
     add(components_color, 0x640000)
     self.assertEqual(1, len(components_color))
     self.assertIn(0x640000, components_color)
示例#2
0
 def test_add_to_max(self):
     components_color = [0x640000]*MAX_COLOR
     add(components_color, 0x006400)
     self.assertNotIn(0x006400, components_color)
     self.assertEqual(MAX_COLOR, len(components_color))
示例#3
0
 def test_add_black(self):
     components_color = []
     add(components_color, COLOR_BLACK)
     self.assertNotIn(COLOR_BLACK, components_color)
     self.assertEqual(0, len(components_color))
示例#4
0
 def test_add_to_one(self):
     components_color = [0x640000]
     add(components_color, 0x006400)
     self.assertIn(0x006400, components_color)
     self.assertEqual(2, len(components_color))
示例#5
0
 def test_add_to_empty(self):
     components_color = []
     add(components_color, 0x640000)
     self.assertIn(0x640000, components_color)
     self.assertEqual(1, len(components_color))