MCPcopy Create free account
hub / github.com/SourceCode-AI/aura / test_local_mirror

Function test_local_mirror

tests/test_mirror.py:11–28  ·  view source on GitHub ↗
(simulate_mirror)

Source from the content-addressed store, hash-verified

9
10
11def test_local_mirror(simulate_mirror):
12 m = mirror.LocalMirror()
13
14 packages = set(x.name for x in m.list_packages())
15 assert "wheel" in packages
16
17 version = "0.34.2"
18 pkg_meta = m.get_json("wheel")
19 assert isinstance(pkg_meta, dict)
20 assert "info" in pkg_meta
21 assert pkg_meta["info"]["name"] == "wheel"
22 assert pkg_meta["info"]["version"] == version
23 assert len(pkg_meta["releases"][version]) == 2
24
25 for pkg_release in pkg_meta["releases"][version]:
26 local_path = m.url2local(pkg_release["url"])
27 assert local_path.is_file(), local_path
28 assert local_path.name == pkg_release["filename"]
29
30
31def test_mirror_uri_handler(simulate_mirror):

Callers

nothing calls this directly

Calls 3

list_packagesMethod · 0.95
get_jsonMethod · 0.95
url2localMethod · 0.95

Tested by

no test coverage detected