Commits

Anonymous committed b85d34c

test storage listdir

  • Participants
  • Parent commits bc919d9

Comments (0)

Files changed (1)

storages/tests/s3boto.py

         
         # show file does not exist
         self.assertFalse(self.storage.exists(name))
+    
+    def test_storage_listdir(self):
+        content = 'not blank'
+        file_names = ["1.txt", "2.txt", "3.txt", "4.txt"]
+        for name in file_names:
+            file = self.storage.open(self.prefix_path(name), 'w')
+            file.write(content)
+            file.close()
+        file = self.storage.open(self.prefix_path('foo/bar.txt'), 'w')
+        file.write(content)
+        file.close()
+        dirs, files = self.storage.listdir(self.path_prefix)
+        for name in file_names:
+            self.assertTrue(name in files)
+        self.assertTrue('foo' in dirs)
+        
+