2021-11-10 06:22:15 +01:00
|
|
|
import pytest
|
|
|
|
from freezegun import freeze_time
|
|
|
|
|
2025-05-19 08:39:53 +02:00
|
|
|
from datahub.testing import mce_helpers
|
2021-12-16 23:07:38 -05:00
|
|
|
from tests.test_helpers.click_helpers import run_datahub_cmd
|
2021-11-10 06:22:15 +01:00
|
|
|
|
|
|
|
FROZEN_TIME = "2020-04-14 07:00:00"
|
|
|
|
|
|
|
|
|
|
|
|
@freeze_time(FROZEN_TIME)
|
|
|
|
@pytest.mark.integration
|
|
|
|
def test_openapi_ingest(pytestconfig, tmp_path):
|
|
|
|
test_resources_dir = pytestconfig.rootpath / "tests/integration/openapi"
|
|
|
|
|
|
|
|
# Run the metadata ingestion pipeline.
|
2021-12-16 23:07:38 -05:00
|
|
|
config_file = (test_resources_dir / "openapi_to_file.yml").resolve()
|
|
|
|
run_datahub_cmd(["ingest", "-c", f"{config_file}"], tmp_path=tmp_path)
|
2021-11-10 06:22:15 +01:00
|
|
|
|
2021-12-16 23:07:38 -05:00
|
|
|
# Verify the output.
|
|
|
|
mce_helpers.check_golden_file(
|
|
|
|
pytestconfig,
|
|
|
|
output_path="/tmp/openapi_mces.json",
|
|
|
|
golden_path=test_resources_dir / "openapi_mces_golden.json",
|
|
|
|
)
|