mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-27 10:44:33 +00:00
functional_tests: Fix site.is_available not handling default paths
Sites might have default paths like /mediawiki/Main_Page or /transmission/web. The tests are doing an exact match on the path which is causing test failures. Modified the support function site.is_available to handle default paths. Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
7df4219bce
commit
fe02b9f1e3
@ -51,8 +51,9 @@ def is_available(browser, site_name):
|
||||
time.sleep(3)
|
||||
browser.reload()
|
||||
not_404 = '404' not in browser.title
|
||||
# A trailing slash might be appended by Apache redirect rules
|
||||
no_redirect = url_to_visit.strip('/') == browser.url.strip('/')
|
||||
# The site might have a default path after the sitename,
|
||||
# e.g /mediawiki/Main_Page
|
||||
no_redirect = browser.url.startswith(url_to_visit.strip('/'))
|
||||
return not_404 and no_redirect
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user