Changeset View
Changeset View
Standalone View
Standalone View
swh/dataset/test/test_orc.py
Show First 20 Lines • Show All 321 Lines • ▼ Show 20 Lines | def test_export_invalid_max_rows(table_name): | ||||
with pytest.raises(ValueError): | with pytest.raises(ValueError): | ||||
exporter({}, config=config) | exporter({}, config=config) | ||||
def test_export_content_with_data(monkeypatch, tmpdir): | def test_export_content_with_data(monkeypatch, tmpdir): | ||||
obj_type = "content" | obj_type = "content" | ||||
objstorage = get_objstorage("memory") | objstorage = get_objstorage("memory") | ||||
for content in TEST_OBJECTS[obj_type]: | for content in TEST_OBJECTS[obj_type]: | ||||
objstorage.add(content.data) | objstorage.add(content.data, content.hashes()) | ||||
def get_objstorage_mock(**kw): | def get_objstorage_mock(**kw): | ||||
if kw.get("cls") == "mock": | if kw.get("cls") == "mock": | ||||
return objstorage | return objstorage | ||||
monkeypatch.setattr(orc, "get_objstorage", get_objstorage_mock) | monkeypatch.setattr(orc, "get_objstorage", get_objstorage_mock) | ||||
config = { | config = { | ||||
"orc": { | "orc": { | ||||
Show All 16 Lines |