Example #1
0
 def testDownloadImage(self):
     self._mockLastFMRequest()
     lastFM = LastFM()
     album_info = lastFM.getAlbumInfo(artist = 'Antonio Vivaldi', album = 'The four seasons')
     self._mockLastFMRequest('fixtures/last_fm/base_cover_image.jpg', 'rb')
     image_destionation_path = os.path.join(os.path.dirname(__file__), 'fixtures/test_downloaded_image.jpg')
     self.assertFalse(os.path.exists(image_destionation_path))
     lastFM.downloadImage(album_info, 'mega', image_destionation_path)
     self.assertTrue(os.path.exists(image_destionation_path))
     os.remove(image_destionation_path)