Adding test for proxy checker/scanner (#2697)

remove-same-checksum-skip
dgtlmoon 3 months ago committed by GitHub
parent c1c8de3104
commit d4b4355ff5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -16,4 +16,4 @@ def test_check_basic_change_detection_functionality(client, live_server, measure
) )
assert b"1 Imported" in res.data assert b"1 Imported" in res.data
time.sleep(3) wait_for_all_checks(client)

@ -1,7 +1,8 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import json
import os import os
from flask import url_for from flask import url_for
from changedetectionio.tests.util import live_server_setup, wait_for_all_checks from changedetectionio.tests.util import live_server_setup, wait_for_all_checks, extract_UUID_from_client
def set_response(): def set_response():
@ -18,7 +19,6 @@ def set_response():
f.write(data) f.write(data)
time.sleep(1) time.sleep(1)
def test_socks5(client, live_server, measure_memory_usage): def test_socks5(client, live_server, measure_memory_usage):
live_server_setup(live_server) live_server_setup(live_server)
set_response() set_response()
@ -79,3 +79,24 @@ def test_socks5(client, live_server, measure_memory_usage):
# Should see the proper string # Should see the proper string
assert "Awesome, you made it".encode('utf-8') in res.data assert "Awesome, you made it".encode('utf-8') in res.data
# PROXY CHECKER WIDGET CHECK - this needs more checking
uuid = extract_UUID_from_client(client)
res = client.get(
url_for("check_proxies.start_check", uuid=uuid),
follow_redirects=True
)
# It's probably already finished super fast :(
#assert b"RUNNING" in res.data
wait_for_all_checks(client)
res = client.get(
url_for("check_proxies.get_recheck_status", uuid=uuid),
follow_redirects=True
)
assert b"OK" in res.data
res = client.get(url_for("form_delete", uuid="all"), follow_redirects=True)
assert b'Deleted' in res.data

Loading…
Cancel
Save