Skip to content

Commit

Permalink
Adding test for proxy checker
Browse files Browse the repository at this point in the history
  • Loading branch information
dgtlmoon committed Oct 11, 2024
1 parent c1c8de3 commit ce95a52
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion changedetectionio/tests/proxy_list/test_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ def test_check_basic_change_detection_functionality(client, live_server, measure
)

assert b"1 Imported" in res.data
time.sleep(3)
wait_for_all_checks(client)
23 changes: 21 additions & 2 deletions changedetectionio/tests/proxy_socks5/test_socks5_proxy.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env python3
import json
import os
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():
Expand All @@ -18,7 +19,6 @@ def set_response():
f.write(data)
time.sleep(1)


def test_socks5(client, live_server, measure_memory_usage):
live_server_setup(live_server)
set_response()
Expand Down Expand Up @@ -79,3 +79,22 @@ def test_socks5(client, live_server, measure_memory_usage):

# Should see the proper string
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
)
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

0 comments on commit ce95a52

Please sign in to comment.