def test_get_set_db_storage_paths(self): if on_windows(): checkpoints_path = "file:/C:/var/checkpoints/" storage_path = [ "file:/C:/var/db_storage_dir1/", "file:/C:/var/db_storage_dir2/", "file:/C:/var/db_storage_dir3/" ] expected = [ "C:\\var\\db_storage_dir1", "C:\\var\\db_storage_dir2", "C:\\var\\db_storage_dir3" ] else: checkpoints_path = "file://var/checkpoints/" storage_path = [ "file://var/db_storage_dir1/", "file://var/db_storage_dir2/", "file://var/db_storage_dir3/" ] expected = [ "/db_storage_dir1", "/db_storage_dir2", "/db_storage_dir3" ] state_backend = RocksDBStateBackend(checkpoints_path) state_backend.set_db_storage_paths(*storage_path) self.assertEqual(state_backend.get_db_storage_paths(), expected)
def test_get_set_db_storage_paths(self): state_backend = RocksDBStateBackend("file://var/checkpoints/") state_backend.set_db_storage_paths("file://var/db_storage_dir1/", "file://var/db_storage_dir2/", "file://var/db_storage_dir3/") self.assertEqual( state_backend.get_db_storage_paths(), ['/db_storage_dir1', '/db_storage_dir2', '/db_storage_dir3'])