def test_url(self): keyword = 'https://example.com' expected = RemoteImage(keyword) actual = ImageSource(keyword) self.assertEqual(type(actual), type(expected))
def test_query(self): keyword = 'cat' expected = KeywordImage(keyword) actual = ImageSource(keyword) self.assertEqual(type(actual), type(expected))
def test_path(self): keyword = './tests/fixtures/test.png' expected = LocalImage(keyword) actual = ImageSource(keyword) self.assertEqual(type(actual), type(expected))
def test_keyword(self): from lgtm.image_source import ImageSource, KeywordImage actual = ImageSource("dog") self.assertEqual(KeywordImage, type(actual))
def test_localpath(self): from lgtm.image_source import ImageSource, LocalImage path = os.path.dirname(__file__) + "/data/test_image.jpg" actual = ImageSource(path) self.assertEqual(LocalImage, type(actual))
def test_https(self): from lgtm.image_source import ImageSource, RemoteImage actual = ImageSource("https://www.example.com") self.assertEqual(RemoteImage, type(actual))