Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7163860
D99.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D99.diff
View Options
diff --git a/swh/objstorage/tests/objstorage_testing.py b/swh/objstorage/tests/objstorage_testing.py
--- a/swh/objstorage/tests/objstorage_testing.py
+++ b/swh/objstorage/tests/objstorage_testing.py
@@ -23,6 +23,14 @@
self.assertEqual(content, expected_content)
@istest
+ def contains(self):
+ content_p, obj_id_p = self.hash_content(b'contains_present')
+ content_m, obj_id_m = self.hash_content(b'contains_missing')
+ self.storage.add(content_p, obj_id=obj_id_p)
+ self.assertIn(obj_id_p, self.storage)
+ self.assertNotIn(obj_id_m, self.storage)
+
+ @istest
def add_get_w_id(self):
content, obj_id = self.hash_content(b'add_get_w_id')
r = self.storage.add(content, obj_id=obj_id)
diff --git a/swh/objstorage/tests/test_objstorage_pathslicing.py b/swh/objstorage/tests/test_objstorage_pathslicing.py
--- a/swh/objstorage/tests/test_objstorage_pathslicing.py
+++ b/swh/objstorage/tests/test_objstorage_pathslicing.py
@@ -15,7 +15,7 @@
from objstorage_testing import ObjStorageTestFixture
-class TestpathSlicingObjStorage(ObjStorageTestFixture, unittest.TestCase):
+class TestPathSlicingObjStorage(ObjStorageTestFixture, unittest.TestCase):
def setUp(self):
super().setUp()
@@ -31,14 +31,6 @@
return self.storage._obj_path(hex_obj_id)
@istest
- def contains(self):
- content_p, obj_id_p = self.hash_content(b'contains_present')
- content_m, obj_id_m = self.hash_content(b'contains_missing')
- self.storage.add(content_p, obj_id=obj_id_p)
- self.assertIn(obj_id_p, self.storage)
- self.assertNotIn(obj_id_m, self.storage)
-
- @istest
def iter(self):
content, obj_id = self.hash_content(b'iter')
self.assertEqual(list(iter(self.storage)), [])
@@ -47,7 +39,7 @@
@istest
def len(self):
- content, obj_id = self.hash_content(b'check_not_gzip')
+ content, obj_id = self.hash_content(b'len')
self.assertEqual(len(self.storage), 0)
self.storage.add(content, obj_id=obj_id)
self.assertEqual(len(self.storage), 1)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 30, 4:58 PM (2 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3218218
Attached To
D99: Move contains test in the ObjStorage test fixture
Event Timeline
Log In to Comment