Esempio n. 1
0
def test_clone(tmp_path: Path):
    dr = set_tmp_dir(tmp_path).parent
    path = dr / "name"
    content = "nodes: []"

    with request_mocker() as m:
        b = io.BytesIO()
        with ZipFile(b, "w") as zf:
            zf.writestr("graph.yml", content)
        m.get(
            API_BASE_URL + Endpoints.graph_version_download("uid"),
            content=b.getvalue(),
        )

        result = run_cli(f"clone --version=uid {path}")
        assert "Cloned graph" in result.output
        assert (path / "graph.yml").read_text() == content
Esempio n. 2
0
File: pull.py Progetto: kvh/snapflow
def download_graph_zip(graph_version_uid: str) -> bytes:
    resp = get(Endpoints.graph_version_download(graph_version_uid))
    resp.raise_for_status()
    return resp.content