import unittest
from fetch import FakeFetcher
-from images import ImageStore
+from images import DiskImageStore
class TestImageStore(unittest.TestCase):
'https://example.com/other_images/carol': b'CAROLINA'})
def testFetchOnce(self) -> None:
- store = ImageStore('istest_fetch_once', self._fetcher)
+ store = DiskImageStore('istest_fetch_once', self._fetcher)
self.assertEqual(self._fetcher.request_count(), 0)
a1 = store.get_image('https://example.com/images/alice.png')
self.assertEqual(self._fetcher.request_count(), 1)
self.assertEqual(a1, a3)
def testNameCollision(self) -> None:
- store = ImageStore('istest_name_collision', self._fetcher)
+ store = DiskImageStore('istest_name_collision', self._fetcher)
self.assertEqual(self._fetcher.request_count(), 0)
b1 = store.get_image('https://example.com/images/bob.jpeg')
self.assertEqual(self._fetcher.request_count(), 1)