Changeset View
Changeset View
Standalone View
Standalone View
swh/objstorage/tests/test_objstorage_instantiation.py
Show All 24 Lines | def setUp(self): | ||||
super().setUp() | super().setUp() | ||||
def tearDown(self): | def tearDown(self): | ||||
super().tearDown() | super().tearDown() | ||||
shutil.rmtree(self.path) | shutil.rmtree(self.path) | ||||
shutil.rmtree(self.path2) | shutil.rmtree(self.path2) | ||||
def test_pathslicing_objstorage(self): | def test_pathslicing_objstorage(self): | ||||
conf = {"cls": "pathslicing", "args": {"root": self.path, "slicing": "0:2/0:5"}} | conf = {"cls": "pathslicing", "root": self.path, "slicing": "0:2/0:5"} | ||||
st = get_objstorage(**conf) | st = get_objstorage(**conf) | ||||
self.assertTrue(isinstance(st, PathSlicingObjStorage)) | self.assertTrue(isinstance(st, PathSlicingObjStorage)) | ||||
def test_remote_objstorage(self): | def test_remote_objstorage(self): | ||||
conf = {"cls": "remote", "args": {"url": "http://127.0.0.1:4242/"}} | conf = {"cls": "remote", "url": "http://127.0.0.1:4242/"} | ||||
st = get_objstorage(**conf) | st = get_objstorage(**conf) | ||||
self.assertTrue(isinstance(st, RemoteObjStorage)) | self.assertTrue(isinstance(st, RemoteObjStorage)) |