mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2026-09-29 00:36:18 +00:00
update tests and api spec
This commit is contained in:
@@ -374,6 +374,9 @@ def test_roundtrip_API(client, live_server, measure_memory_usage, datastore_path
|
||||
watch['last_changed'] = 454444444444
|
||||
watch['date_created'] = 454444444444
|
||||
|
||||
# Exercise the new extract_lines_containing field
|
||||
watch['extract_lines_containing'] = ['celsius', 'temperature']
|
||||
|
||||
# HTTP PUT ( UPDATE an existing watch )
|
||||
res = client.put(
|
||||
url_for("watch", uuid=uuid),
|
||||
@@ -397,6 +400,9 @@ def test_roundtrip_API(client, live_server, measure_memory_usage, datastore_path
|
||||
assert date_created != 454444444444
|
||||
assert date_created != "454444444444"
|
||||
|
||||
assert res.json.get('extract_lines_containing') == ['celsius', 'temperature'], \
|
||||
"extract_lines_containing should be persisted and returned via API"
|
||||
|
||||
|
||||
def test_access_denied(client, live_server, measure_memory_usage, datastore_path):
|
||||
# `config_api_token_enabled` Should be On by default
|
||||
|
||||
@@ -460,6 +460,13 @@ components:
|
||||
maxLength: 5000
|
||||
maxItems: 100
|
||||
description: Text that should NOT be present (triggers alert if found)
|
||||
extract_lines_containing:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
maxLength: 5000
|
||||
maxItems: 100
|
||||
description: Keep only lines containing these substrings (plain text, case-insensitive) — simpler alternative to regex
|
||||
extract_text:
|
||||
type: array
|
||||
items:
|
||||
|
||||
Reference in New Issue
Block a user