mirror of
https://github.com/YunoHost/package_check.git
synced 2024-09-03 20:06:20 +02:00
curl tests: misc fixes after tests on the battefield
This commit is contained in:
parent
6d96c6ad0e
commit
9cda3a8219
1 changed files with 9 additions and 5 deletions
|
@ -121,15 +121,15 @@ def test(
|
||||||
cookies = tempfile.NamedTemporaryFile().name
|
cookies = tempfile.NamedTemporaryFile().name
|
||||||
|
|
||||||
if DIST == "bullseye":
|
if DIST == "bullseye":
|
||||||
code, content, _ = curl(
|
code, content, log_url = curl(
|
||||||
f"https://{domain}/yunohost/sso",
|
f"https://{DOMAIN}/yunohost/sso",
|
||||||
"/",
|
"/",
|
||||||
save_cookies=cookies,
|
save_cookies=cookies,
|
||||||
post={"user": USER, "password": PASSWORD},
|
post={"user": USER, "password": PASSWORD},
|
||||||
referer=f"https://{domain}/yunohost/sso/",
|
referer=f"https://{DOMAIN}/yunohost/sso/",
|
||||||
)
|
)
|
||||||
assert (
|
assert (
|
||||||
code == 200 and os.system(f"grep -q '{domain}' {cookies}") == 0
|
code == 200 and os.system(f"grep -q '{DOMAIN}' {cookies}") == 0
|
||||||
), f"Failed to log in: got code {code} or cookie file was empty?"
|
), f"Failed to log in: got code {code} or cookie file was empty?"
|
||||||
else:
|
else:
|
||||||
code, content, _ = curl(
|
code, content, _ = curl(
|
||||||
|
@ -212,6 +212,10 @@ def test(
|
||||||
for asset in assets_to_check:
|
for asset in assets_to_check:
|
||||||
if asset.startswith(f"https://{domain}"):
|
if asset.startswith(f"https://{domain}"):
|
||||||
asset = asset.replace(f"https://{domain}", "")
|
asset = asset.replace(f"https://{domain}", "")
|
||||||
|
elif asset.startswith(f"{domain}/"):
|
||||||
|
asset = asset.replace(f"{domain}/", "")
|
||||||
|
if not asset.startswith("/"):
|
||||||
|
asset = "/" + asset
|
||||||
asset_code, _, effective_asset_url = curl(
|
asset_code, _, effective_asset_url = curl(
|
||||||
f"https://{domain}", asset, use_cookies=cookies
|
f"https://{domain}", asset, use_cookies=cookies
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue