Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiommendes committed Sep 9, 2016
1 parent a3fb1c4 commit a9abd5a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/colortools/tests/test_colortools.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,24 @@ def test_color_compares_with_tuple():
assert color == (255, 0, 0)


def test_getitem_color():
def test_color_is_iterable():
assert list(Color(1, 2, 3, 4)) == [1, 2, 3, 4]


def test_getitem():
color = Color(1, 2, 3, 4)
assert color[0] == 1
assert color[1] == 2
assert color[2] == 3
assert color[3] == 4


def test_getitem_negative():
color = Color(1, 2, 3, 4)
assert color[-1] == 4
assert len(color) == 4


def test_getitem_fails():
color = Color(1, 2, 3, 4)
with pytest.raises(IndexError):
Expand Down

0 comments on commit a9abd5a

Please sign in to comment.