def test_hex_colors(self): """ Test that rgb_sweep works on hexadecimal strings """ colors = list(rgb_sweep(10, source="#ffffff", dest="#000000")) self.assertSequenceEqual(colors[0], (1.0, 1.0, 1.0)) self.assertSequenceEqual(colors[-1], (0.0, 0.0, 0.0))
def test_source_equal_to_dest(self): """ Test that rgb_sweep still works if source is equal to destination.""" colors = rgb_sweep(10, source=(1, 0, 0), dest=(1, 0, 0)) self.assertEqual(len(list(colors)), 10)
def test_on_ints(self): """ Test the number of elements yielded from rgb_sweep """ colors = rgb_sweep(10, source=(1, 0, 0), dest=(0, 1, 0)) self.assertEqual(len(list(colors)), 10)
def test_rgb_sweephex_colors(): """ Test that rgb_sweep works on hexadecimal strings """ colors = list(rgb_sweep(10, source="#ffffff", dest="#000000")) assert colors[0] == (1.0, 1.0, 1.0) assert colors[-1] == (0.0, 0.0, 0.0)
def test_rgb_sweepsource_equal_to_dest(): """ Test that rgb_sweep still works if source is equal to destination.""" colors = rgb_sweep(10, source=(1, 0, 0), dest=(1, 0, 0)) assert len(list(colors)) == 10
def test_rgb_sweep_on_ints(): """ Test the number of elements yielded from rgb_sweep """ colors = rgb_sweep(10, source=(1, 0, 0), dest=(0, 1, 0)) assert len(list(colors)) == 10