26 lines
775 B
Python
Raw Normal View History

2021-02-11 21:17:59 -08:00
from gometa.ingestion.run.pipeline import Pipeline
2021-02-11 18:31:15 -08:00
import mce_helpers
def test_serde_large(pytestconfig, tmp_path):
json_filename = "test_serde_large.json"
2021-02-11 21:17:59 -08:00
output_filename = "output.json"
2021-02-11 18:31:15 -08:00
test_resources_dir = pytestconfig.rootpath / "tests/unit/serde"
golden_file = test_resources_dir / json_filename
2021-02-11 21:17:59 -08:00
output_file = tmp_path / output_filename
2021-02-11 21:34:36 -08:00
pipeline = Pipeline.create(
{
2021-02-11 21:59:54 -08:00
'source': {'type': 'file', 'file': {'filename': str(golden_file)}},
'sink': {'type': 'file', 'file': {'filename': str(output_file)}},
2021-02-11 21:17:59 -08:00
}
2021-02-11 21:34:36 -08:00
)
2021-02-11 21:17:59 -08:00
pipeline.run()
2021-02-11 18:31:15 -08:00
output = mce_helpers.load_json_file(tmp_path / output_filename)
golden = mce_helpers.load_json_file(golden_file)
mce_helpers.assert_mces_equal(output, golden)