def test_passing():
    assert only_red([[255, 0, 0]]) == [[255, 0, 0]]
    assert only_red([[2, 2, 2]]) == [[2, 0, 0]]
    assert only_red([[9, 9, 10]]) == [[9, 0, 0]]
def test_not_passing():
    assert only_red([[255, 0, 0]]) != [[0, 0, 0]]
    assert only_red([[2, 0, 0]]) != []
    assert only_red([[9, 9, 100]]) != [[9, 9, 9]]
Example #3
0
 def test_only_red(self):
     image_list = image_editor.read_image('tinypix.ppm')
     input = image_editor.only_red(image_list)
     expected_output = image_editor.read_image('expected_red_output.ppm')
     self.assertEqual(input, expected_output)