Added test exposing a bug in Shelf.getImageVersionsInDirectory.
authorJoel Rosdahl <joel@rosdahl.net>
Mon, 11 Jul 2005 08:17:27 +0000 (08:17 +0000)
committerJoel Rosdahl <joel@rosdahl.net>
Mon, 11 Jul 2005 08:17:27 +0000 (08:17 +0000)
src/test/shelftests.py

index 29d085a..61d729a 100755 (executable)
@@ -363,8 +363,16 @@ class TestShelfMethods(TestShelfFixture):
         assert len(imageversions) == 11
 
     def test_getImageVersionsInDirectory(self):
+        self.shelf.flushImageVersionCache()
+
         imageversions = list(self.shelf.getImageVersionsInDirectory(u"."))
         assert len(imageversions) == 0
+
+        # Image versions not in cache.
+        imageversions = list(self.shelf.getImageVersionsInDirectory(PICDIR))
+        assert len(imageversions) == 11
+
+        # Image versions in cache.
         imageversions = list(self.shelf.getImageVersionsInDirectory(PICDIR))
         assert len(imageversions) == 11