Skip to content

Commit

Permalink
Marginally increase test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jarhill0 committed Feb 17, 2018
1 parent 7823c72 commit 8d1bd9f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/unit/models/main_models/test_photo_size.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,38 @@ def test_eq():
assert ps1 != same_size
assert ps2 != same_size

different_size = PhotoSize(TG, dict(file_id=67890, width=640, height=1000))
assert different_size != ps1


def test_gt():
ps1 = PhotoSize(TG, DICT_1)
bigger = PhotoSize(TG, dict(file_id=1, width=641, height=1000))

assert bigger > ps1

try:
bigger > 3
except TypeError:
pass
else:
assert False, "These types are not comparable"

try:
bigger > '3'
except TypeError:
pass
else:
assert False, "These types are not comparable"

try:
bigger > Telegram
except TypeError:
pass
else:
assert False, "These types are not comparable"


def test_repr():
ps = PhotoSize(TG, DICT_1)
assert repr(ps) == '<PhotoSize 12345>'
5 changes: 5 additions & 0 deletions tests/unit/models/main_models/test_sticker.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@ def test_mask_pos():
pass
else:
assert False


def test_repr():
sticker = Sticker(TG, data=dict(width=512, height=510, file_id=12345))
assert repr(sticker) == '<Sticker 12345>'

0 comments on commit 8d1bd9f

Please sign in to comment.