summaryrefslogtreecommitdiff
path: root/testing/tests/blobs/test_fs_backend.py
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2017-08-10 00:15:01 -0300
committerKali Kaneko <kali@leap.se>2017-08-11 18:52:07 -0400
commit78621bb742cd0a816dc507010743a7d765d84538 (patch)
treeef27a78b024142906c1598798ae5b8c139003999 /testing/tests/blobs/test_fs_backend.py
parent0942f91b1f09f2ee69d88aa51edfb83cb2b6a7be (diff)
[feature] add path partitioning to namespaces
All blobs were being stored in a single folder when using namespaces, this commits adds path partitioning as discussed on #8882, which should help with a large number of files (each folder will hold a smaller subset, allowing the use of better filesystem walk strategies). Also, the default empty namespace is now called 'default' to prevent it from listing other namespaces contents. So everything will always use namespaces, with the option to use it explicitly or just fall to the default one. -- Related: #8882
Diffstat (limited to 'testing/tests/blobs/test_fs_backend.py')
-rw-r--r--testing/tests/blobs/test_fs_backend.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/testing/tests/blobs/test_fs_backend.py b/testing/tests/blobs/test_fs_backend.py
index f742f702..53f3127d 100644
--- a/testing/tests/blobs/test_fs_backend.py
+++ b/testing/tests/blobs/test_fs_backend.py
@@ -88,13 +88,15 @@ class FilesystemBackendTestCase(unittest.TestCase):
backend = _blobs.FilesystemBlobsBackend()
backend.path = '/somewhere/'
path = backend._get_path('user', 'blob_id', '')
- self.assertEquals(path, '/somewhere/user/b/blo/blob_i/blob_id')
+ expected = '/somewhere/user/default/b/blo/blob_i/blob_id'
+ self.assertEquals(path, expected)
def test_get_path_custom(self):
backend = _blobs.FilesystemBlobsBackend()
backend.path = '/somewhere/'
path = backend._get_path('user', 'blob_id', 'wonderland')
- self.assertEquals(path, '/somewhere/user/wonderland/blob_id')
+ expected = '/somewhere/user/wonderland/b/blo/blob_i/blob_id'
+ self.assertEquals(expected, path)
def test_get_path_namespace_traversal_raises(self):
backend = _blobs.FilesystemBlobsBackend()