def test_pkgserv(httpget, pypistage, testapp):
pypistage.mock_simple("package", '<a href="/package-1.0.zip" />')
pypistage.mock_extfile("/package-1.0.zip", b"123")
r = testapp.get("/root/pypi/+simple/package")
assert r.status_code == 200
href = getfirstlink(r.text).get("href")
assert not posixpath.isabs(href)
url = URL(r.request.url).joinpath(href).url
r = testapp.get(url)
assert r.body == b"123"
评论列表
文章目录