mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2026-05-03 08:10:37 +00:00
Also test for 204 - with empty reply
This commit is contained in:
@@ -20,7 +20,7 @@ def test_setup(client, live_server):
|
||||
|
||||
# Assert that non-200's dont give notifications or register as a change
|
||||
def test_non_200_doesnt_trigger_change(client, live_server):
|
||||
# live_server_setup(live_server)
|
||||
# live_server_setup(live_server)
|
||||
|
||||
set_original_response()
|
||||
url = url_for('test_changing_status_code_endpoint', _external=True)
|
||||
@@ -58,7 +58,7 @@ def test_non_200_doesnt_trigger_change(client, live_server):
|
||||
set_modified_response()
|
||||
|
||||
# https://github.com/dgtlmoon/changedetection.io/issues/962#issuecomment-1416807742
|
||||
for ecode in ['429', '400', '429', '403', '404', '500']:
|
||||
for ecode in ['429', '400', '204', '429', '403', '404', '500']:
|
||||
with open("test-endpoint-status-code.txt", 'w') as f:
|
||||
f.write(ecode)
|
||||
|
||||
|
||||
@@ -127,6 +127,8 @@ def live_server_setup(live_server):
|
||||
# (Non-200 should get ignored)
|
||||
with open("test-datastore/endpoint-content.txt", "r") as f:
|
||||
contents ="{} code: {} ".format(f.read(), status_code)
|
||||
if status_code == '204':
|
||||
contents=''
|
||||
resp = make_response(contents, status_code)
|
||||
resp.headers['Content-Type'] = 'text/html'
|
||||
return resp, status_code
|
||||
|
||||
Reference in New Issue
Block a user