■ ■ ■ ■ ■ ■
changedetectionio/tests/proxy_list/test_multiple_proxy.py
| skipped 1 lines |
2 | 2 | | |
3 | 3 | | import time |
4 | 4 | | from flask import url_for |
5 | | - | from ..util import live_server_setup, wait_for_all_checks, extract_UUID_from_client |
| 5 | + | from ..util import live_server_setup |
6 | 6 | | |
7 | | - | def test_check_basic_change_detection_functionality(client, live_server): |
| 7 | + | def test_preferred_proxy(client, live_server): |
8 | 8 | | time.sleep(1) |
9 | 9 | | live_server_setup(live_server) |
10 | 10 | | time.sleep(1) |
| 11 | + | url = "http://chosen.changedetection.io" |
| 12 | + | |
11 | 13 | | res = client.post( |
12 | 14 | | url_for("import_page"), |
13 | 15 | | # Because a URL wont show in squid/proxy logs due it being SSLed |
14 | 16 | | # Use plain HTTP or a specific domain-name here |
15 | | - | data={"urls": "http://one.changedetection.io"}, |
| 17 | + | data={"urls": url}, |
16 | 18 | | follow_redirects=True |
17 | 19 | | ) |
18 | 20 | | |
19 | | - | assert b"1 Imported" in res.data |
| 21 | + | assert b"2 Imported" in res.data |
| 22 | + | |
20 | 23 | | time.sleep(2) |
| 24 | + | res = client.post( |
| 25 | + | url_for("edit_page", uuid="first"), |
| 26 | + | data={ |
| 27 | + | "css_filter": "", |
| 28 | + | "fetch_backend": "html_requests", |
| 29 | + | "headers": "", |
| 30 | + | "proxy": "proxy-two", |
| 31 | + | "tag": "", |
| 32 | + | "url": url, |
| 33 | + | }, |
| 34 | + | follow_redirects=True |
| 35 | + | ) |
| 36 | + | assert b"Updated watch." in res.data |
| 37 | + | time.sleep(2) |
| 38 | + | # Now the request should appear in the second-squid logs |
21 | 39 | | |