Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions lib/curl_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,18 @@ def code_was_expected(code: int) -> bool:
raise ValueError("expect_return_code should be list or int")

errors = []
if expect_effective_url is None and "/yunohost/sso" in effective_url:

if expect_effective_url:
expect_effective_url = expect_effective_url.replace("__DOMAIN__", APP_DOMAIN)
if expect_effective_url != effective_url:
errors.append(
f"Ended up on URL '{effective_url}', but was expecting '{expect_effective_url}'"
)
elif "/yunohost/sso" in effective_url:
errors.append(
f"The request was redirected to yunohost's portal ({effective_url})"
)
if expect_effective_url and expect_effective_url != effective_url:
errors.append(
f"Ended up on URL '{effective_url}', but was expecting '{expect_effective_url}'"
)

if not code_was_expected(code):
errors.append(f"Got return code {code}, but was expecting {expect_return_code}")
if expect_title is None and "Welcome to nginx" in title:
Expand Down