Ejemplo n.º 1
0
def test_format_pipelines_data_legacy(pipeline, old_catalog_with_layers,
                                      mocker):
    mocker.patch("kedro_viz.server._CATALOG", old_catalog_with_layers)
    result = format_pipelines_data(pipeline)
    result_file_path = Path(__file__).parent / "test-format.json"
    json_data = json.loads(result_file_path.read_text())
    assert json_data == result
Ejemplo n.º 2
0
def test_format_pipelines_data_no_layers(pipeline, new_catalog_with_layers,
                                         mocker):
    mocker.patch("kedro_viz.server._CATALOG", new_catalog_with_layers)
    setattr(new_catalog_with_layers, "layers", None)
    result = format_pipelines_data(pipeline)
    assert result["layers"] == []