Changeset View
Changeset View
Standalone View
Standalone View
swh/graph/tests/test_luigi.py
Show All 20 Lines | task = CompressGraph( | ||||
local_graph_path=tmpdir / "compressed_graph", | local_graph_path=tmpdir / "compressed_graph", | ||||
batch_size=1000, # go fast on the trivial dataset | batch_size=1000, # go fast on the trivial dataset | ||||
) | ) | ||||
task.run() | task.run() | ||||
properties = read_properties(tmpdir / "compressed_graph" / "graph.properties") | properties = read_properties(tmpdir / "compressed_graph" / "graph.properties") | ||||
assert int(properties["nodes"]) == 21 | assert int(properties["nodes"]) == 24 | ||||
assert int(properties["arcs"]) == 23 | assert int(properties["arcs"]) == 28 | ||||
export_meta_path = tmpdir / "compressed_graph/meta/export.json" | export_meta_path = tmpdir / "compressed_graph/meta/export.json" | ||||
assert export_meta_path.read_bytes() == (DATA_DIR / "meta/export.json").read_bytes() | assert export_meta_path.read_bytes() == (DATA_DIR / "meta/export.json").read_bytes() | ||||
compression_meta_path = tmpdir / "compressed_graph/meta/compression.json" | compression_meta_path = tmpdir / "compressed_graph/meta/compression.json" | ||||
assert json.load(compression_meta_path.open())[0]["conf"] == {"batch_size": 1000} | assert json.load(compression_meta_path.open())[0]["conf"] == {"batch_size": 1000} |