Skip to content
This repository was archived by the owner on Sep 12, 2018. It is now read-only.

Commit 808c04c

Browse files
committed
Check listing of directory with subdirectories.
It makes appear problems with driver that return all the files matching path, regardless of how deep they are in their filesystem tree.
1 parent 07c7b78 commit 808c04c

File tree

1 file changed

+16
-0
lines changed
  • depends/docker-registry-core/docker_registry/testing

1 file changed

+16
-0
lines changed

depends/docker-registry-core/docker_registry/testing/driver.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,22 @@ def test_list_directory(self):
283283
assert sorted([fb1, fb2]
284284
) == sorted(list(self._storage.list_directory(base)))
285285

286+
def test_list_directory_with_subdir(self):
287+
base = self.gen_random_string()
288+
dir1 = self.gen_random_string()
289+
dir2 = self.gen_random_string()
290+
filename1 = self.gen_random_string()
291+
filename2 = self.gen_random_string()
292+
fd1 = '%s/%s' % (base, dir1)
293+
fd2 = '%s/%s' % (base, dir2)
294+
fb1 = '%s/%s' % (fd1, filename1)
295+
fb2 = '%s/%s' % (fd2, filename2)
296+
content = self.gen_random_string().encode('utf8')
297+
self._storage.put_content(fb1, content)
298+
self._storage.put_content(fb2, content)
299+
assert sorted([fd1, fd2]
300+
) == sorted(list(self._storage.list_directory(base)))
301+
286302
# def test_root_list_directory(self):
287303
# fb1 = self.gen_random_string()
288304
# fb2 = self.gen_random_string()

0 commit comments

Comments
 (0)