Skip to content

Commit

Permalink
Add tests for CoverArtImage __repr__() and __str__()
Browse files Browse the repository at this point in the history
  • Loading branch information
zas committed Sep 14, 2023
1 parent 5e9c4b4 commit 72e1dee
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/test_coverart_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,23 @@ def create_image(extra_data, types=None, support_types=False,


class CoverArtImageTest(PicardTestCase):
def test_repr_str_1(self):
image = CoverArtImage(
url='url', types=["booklet", "front"],
comment='comment', support_types=True,
support_multi_types=True
)
expected = "CoverArtImage(url='url', types=['booklet', 'front'], support_types=True, support_multi_types=True, comment='comment')"
self.assertEqual(expected, repr(image))
expected = "Image from url of type booklet,front and comment 'comment'"
self.assertEqual(expected, str(image))

def test_repr_str_2(self):
image = CoverArtImage()
expected = "CoverArtImage(support_types=False, support_multi_types=False)"
self.assertEqual(expected, repr(image))
expected = "Image"
self.assertEqual(expected, str(image))

def test_is_front_image_no_types(self):
image = create_image(b'a')
Expand Down

0 comments on commit 72e1dee

Please sign in to comment.