|
|
@ -2,7 +2,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
import time
|
|
|
|
import time
|
|
|
|
from flask import url_for
|
|
|
|
from flask import url_for
|
|
|
|
from . util import live_server_setup
|
|
|
|
from .util import live_server_setup, wait_for_all_checks
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def set_original_ignore_response():
|
|
|
|
def set_original_ignore_response():
|
|
|
@ -64,7 +64,7 @@ def test_trigger_functionality(client, live_server):
|
|
|
|
set_original_ignore_response()
|
|
|
|
set_original_ignore_response()
|
|
|
|
|
|
|
|
|
|
|
|
# Give the endpoint time to spin up
|
|
|
|
# Give the endpoint time to spin up
|
|
|
|
time.sleep(1)
|
|
|
|
wait_for_all_checks(client)
|
|
|
|
|
|
|
|
|
|
|
|
# Add our URL to the import page
|
|
|
|
# Add our URL to the import page
|
|
|
|
test_url = url_for('test_endpoint', _external=True)
|
|
|
|
test_url = url_for('test_endpoint', _external=True)
|
|
|
@ -96,7 +96,7 @@ def test_trigger_functionality(client, live_server):
|
|
|
|
assert bytes(trigger_text.encode('utf-8')) in res.data
|
|
|
|
assert bytes(trigger_text.encode('utf-8')) in res.data
|
|
|
|
|
|
|
|
|
|
|
|
# Give the thread time to pick it up
|
|
|
|
# Give the thread time to pick it up
|
|
|
|
time.sleep(sleep_time_for_fetch_thread)
|
|
|
|
wait_for_all_checks(client)
|
|
|
|
|
|
|
|
|
|
|
|
# so that we set the state to 'unviewed' after all the edits
|
|
|
|
# so that we set the state to 'unviewed' after all the edits
|
|
|
|
client.get(url_for("diff_history_page", uuid="first"))
|
|
|
|
client.get(url_for("diff_history_page", uuid="first"))
|
|
|
@ -105,7 +105,7 @@ def test_trigger_functionality(client, live_server):
|
|
|
|
client.get(url_for("form_watch_checknow"), follow_redirects=True)
|
|
|
|
client.get(url_for("form_watch_checknow"), follow_redirects=True)
|
|
|
|
|
|
|
|
|
|
|
|
# Give the thread time to pick it up
|
|
|
|
# Give the thread time to pick it up
|
|
|
|
time.sleep(sleep_time_for_fetch_thread)
|
|
|
|
wait_for_all_checks(client)
|
|
|
|
|
|
|
|
|
|
|
|
# It should report nothing found (no new 'unviewed' class)
|
|
|
|
# It should report nothing found (no new 'unviewed' class)
|
|
|
|
res = client.get(url_for("index"))
|
|
|
|
res = client.get(url_for("index"))
|
|
|
@ -118,18 +118,19 @@ def test_trigger_functionality(client, live_server):
|
|
|
|
# Trigger a check
|
|
|
|
# Trigger a check
|
|
|
|
client.get(url_for("form_watch_checknow"), follow_redirects=True)
|
|
|
|
client.get(url_for("form_watch_checknow"), follow_redirects=True)
|
|
|
|
# Give the thread time to pick it up
|
|
|
|
# Give the thread time to pick it up
|
|
|
|
time.sleep(sleep_time_for_fetch_thread)
|
|
|
|
wait_for_all_checks(client)
|
|
|
|
|
|
|
|
|
|
|
|
# It should report nothing found (no new 'unviewed' class)
|
|
|
|
# It should report nothing found (no new 'unviewed' class)
|
|
|
|
res = client.get(url_for("index"))
|
|
|
|
res = client.get(url_for("index"))
|
|
|
|
assert b'unviewed' not in res.data
|
|
|
|
assert b'unviewed' not in res.data
|
|
|
|
|
|
|
|
|
|
|
|
# Now set the content which contains the trigger text
|
|
|
|
# Now set the content which contains the trigger text
|
|
|
|
time.sleep(sleep_time_for_fetch_thread)
|
|
|
|
wait_for_all_checks(client)
|
|
|
|
set_modified_with_trigger_text_response()
|
|
|
|
set_modified_with_trigger_text_response()
|
|
|
|
|
|
|
|
|
|
|
|
client.get(url_for("form_watch_checknow"), follow_redirects=True)
|
|
|
|
client.get(url_for("form_watch_checknow"), follow_redirects=True)
|
|
|
|
time.sleep(sleep_time_for_fetch_thread)
|
|
|
|
wait_for_all_checks(client)
|
|
|
|
|
|
|
|
|
|
|
|
res = client.get(url_for("index"))
|
|
|
|
res = client.get(url_for("index"))
|
|
|
|
assert b'unviewed' in res.data
|
|
|
|
assert b'unviewed' in res.data
|
|
|
|
|
|
|
|
|
|
|
|