kopia lustrzana https://github.com/dgtlmoon/changedetection.io
test fixes due to dnspython and other changes
rodzic
75e6fbd624
commit
6c3e88e261
|
@ -5,8 +5,6 @@ import time
|
||||||
from flask import url_for
|
from flask import url_for
|
||||||
from .util import live_server_setup, wait_for_all_checks
|
from .util import live_server_setup, wait_for_all_checks
|
||||||
|
|
||||||
from ..html_tools import *
|
|
||||||
|
|
||||||
def test_setup(live_server):
|
def test_setup(live_server):
|
||||||
live_server_setup(live_server)
|
live_server_setup(live_server)
|
||||||
|
|
||||||
|
@ -79,7 +77,14 @@ def test_DNS_errors(client, live_server, measure_memory_usage):
|
||||||
wait_for_all_checks(client)
|
wait_for_all_checks(client)
|
||||||
|
|
||||||
res = client.get(url_for("watchlist.index"))
|
res = client.get(url_for("watchlist.index"))
|
||||||
found_name_resolution_error = b"No address found" in res.data or b"Name or service not known" in res.data
|
found_name_resolution_error = (
|
||||||
|
b"No address found" in res.data or
|
||||||
|
b"Name or service not known" in res.data or
|
||||||
|
b"nodename nor servname provided" in res.data or
|
||||||
|
b"Temporary failure in name resolution" in res.data or
|
||||||
|
b"Failed to establish a new connection" in res.data or
|
||||||
|
b"Connection error occurred" in res.data
|
||||||
|
)
|
||||||
assert found_name_resolution_error
|
assert found_name_resolution_error
|
||||||
# Should always record that we tried
|
# Should always record that we tried
|
||||||
assert bytes("just now".encode('utf-8')) in res.data
|
assert bytes("just now".encode('utf-8')) in res.data
|
||||||
|
@ -108,7 +113,14 @@ def test_low_level_errors_clear_correctly(client, live_server, measure_memory_us
|
||||||
|
|
||||||
# We should see the DNS error
|
# We should see the DNS error
|
||||||
res = client.get(url_for("watchlist.index"))
|
res = client.get(url_for("watchlist.index"))
|
||||||
found_name_resolution_error = b"No address found" in res.data or b"Name or service not known" in res.data
|
found_name_resolution_error = (
|
||||||
|
b"No address found" in res.data or
|
||||||
|
b"Name or service not known" in res.data or
|
||||||
|
b"nodename nor servname provided" in res.data or
|
||||||
|
b"Temporary failure in name resolution" in res.data or
|
||||||
|
b"Failed to establish a new connection" in res.data or
|
||||||
|
b"Connection error occurred" in res.data
|
||||||
|
)
|
||||||
assert found_name_resolution_error
|
assert found_name_resolution_error
|
||||||
|
|
||||||
# Update with what should work
|
# Update with what should work
|
||||||
|
@ -123,7 +135,14 @@ def test_low_level_errors_clear_correctly(client, live_server, measure_memory_us
|
||||||
# Now the error should be gone
|
# Now the error should be gone
|
||||||
wait_for_all_checks(client)
|
wait_for_all_checks(client)
|
||||||
res = client.get(url_for("watchlist.index"))
|
res = client.get(url_for("watchlist.index"))
|
||||||
found_name_resolution_error = b"No address found" in res.data or b"Name or service not known" in res.data
|
found_name_resolution_error = (
|
||||||
|
b"No address found" in res.data or
|
||||||
|
b"Name or service not known" in res.data or
|
||||||
|
b"nodename nor servname provided" in res.data or
|
||||||
|
b"Temporary failure in name resolution" in res.data or
|
||||||
|
b"Failed to establish a new connection" in res.data or
|
||||||
|
b"Connection error occurred" in res.data
|
||||||
|
)
|
||||||
assert not found_name_resolution_error
|
assert not found_name_resolution_error
|
||||||
|
|
||||||
res = client.get(url_for("ui.form_delete", uuid="all"), follow_redirects=True)
|
res = client.get(url_for("ui.form_delete", uuid="all"), follow_redirects=True)
|
||||||
|
|
|
@ -60,7 +60,15 @@ def test_check_notification_error_handling(client, live_server, measure_memory_u
|
||||||
# The error should show in the notification logs
|
# The error should show in the notification logs
|
||||||
res = client.get(
|
res = client.get(
|
||||||
url_for("settings.notification_logs"))
|
url_for("settings.notification_logs"))
|
||||||
found_name_resolution_error = b"No address found" in res.data or b"Name or service not known" in res.data
|
# Check for various DNS/connection error patterns that may appear in different environments
|
||||||
|
found_name_resolution_error = (
|
||||||
|
b"No address found" in res.data or
|
||||||
|
b"Name or service not known" in res.data or
|
||||||
|
b"nodename nor servname provided" in res.data or
|
||||||
|
b"Temporary failure in name resolution" in res.data or
|
||||||
|
b"Failed to establish a new connection" in res.data or
|
||||||
|
b"Connection error occurred" in res.data
|
||||||
|
)
|
||||||
assert found_name_resolution_error
|
assert found_name_resolution_error
|
||||||
|
|
||||||
# And the working one, which is after the 'broken' one should still have fired
|
# And the working one, which is after the 'broken' one should still have fired
|
||||||
|
|
Ładowanie…
Reference in New Issue