Add test for invalid URL

This commit is contained in:
Alok Saboo 2023-04-21 08:31:36 -04:00
parent 919f326400
commit 47cb11bad7

View file

@ -100,6 +100,17 @@ class EmbedartCliTest(TestHelper, FetchImageHelper):
mediafile.images[0].data,
self.IMAGEHEADER.get('image/png').ljust(32, b'\x00'))
# test embedart with url that does not have a valid image
def test_embed_art_from_url_with_yes_input_not_image(self):
self._setup_data()
album = self.add_album_fixture()
item = album.items()[0]
self.mock_response('http://example.com/test.txt', 'text/html')
self.io.addinput('y')
self.run_command('embedart', '-u', 'http://example.com/test.txt')
mediafile = MediaFile(syspath(item.path))
self.assertFalse(mediafile.images)
def test_embed_art_from_file_with_no_input(self):
self._setup_data()
album = self.add_album_fixture()