def test_colorize(): colors = ["green", "yellow", "red"] values = [2, 5, 1, 3, 4, 0] legend, results = colorize(colors, values) assert results == [(2, "yellow"), (5, "red"), (1, "green"), (3, "yellow"), (4, "red"), (0, "green")]
def test_colorize(): colors = ["green", "yellow", "red"] values = [2, 5, 1, 3, 4, 0] legend, results = colorize(colors, values) assert results == [ (2, "yellow"), (5, "red"), (1, "green"), (3, "yellow"), (4, "red"), (0, "green"), ] legend, results = colorize(colors, []) assert results == []
def test_colorize(): colors = ['green', 'yellow', 'red'] values = [2, 5, 1, 3, 4, 0] legend, results = colorize(colors, values) assert results == [ (2, 'yellow'), (5, 'red'), (1, 'green'), (3, 'yellow'), (4, 'red'), (0, 'green'), ]
def test_colorize(): colors = ['green', 'yellow', 'red'] values = [2, 5, 1, 3, 4, 0] legend, results = colorize(colors, values) assert results == [ (2, 'yellow'), (5, 'red'), (1, 'green'), (3, 'yellow'), (4, 'red'), (0, 'green'), ]