def test_get_size(self): resp = b'some_image' self.opener = _common.FakeOpener(resp) musicbrainzngs.compat.build_opener = lambda *args: self.opener res = caa.get_image("8ec178f4-a8e8-4f22-bcba-1964466ef214", "1234", 250) self.assertEqual("http://coverartarchive.org/release/8ec178f4-a8e8-4f22-bcba-1964466ef214/1234-250", self.opener.myurl) self.assertEqual(resp, res)
def test_coverid(self): resp = 'some_image' self.opener = _common.FakeOpener(resp) musicbrainzngs.compat.build_opener = lambda *args: self.opener res = caa.get_image("8ec178f4-a8e8-4f22-bcba-1964466ef214", "1234") self.assertEqual( "http://coverartarchive.org/release/8ec178f4-a8e8-4f22-bcba-1964466ef214/1234", self.opener.myurl) self.assertEqual(resp, res)