def test_jpeg_type_returns_path(self): fetchart.urllib.urlretrieve = MockUrlRetrieve('image/jpeg') artpath = fetchart._fetch_image('http://example.com') self.assertNotEqual(artpath, None)
def test_jpeg_type_returns_path(self): self.mock_response('image/jpeg') artpath = fetchart._fetch_image('http://example.com') self.assertNotEqual(artpath, None)
def test_invalid_type_returns_none(self): fetchart.urllib.urlretrieve = MockUrlRetrieve('') artpath = fetchart._fetch_image('http://example.com') self.assertEqual(artpath, None)
def test_invalid_type_returns_none(self): self.mock_response('image/watercolour') artpath = fetchart._fetch_image('http://example.com') self.assertEqual(artpath, None)