update tests and api spec

This commit is contained in:
dgtlmoon
2026-04-11 04:57:05 +02:00
parent ac9f220147
commit 2a09f21722
2 changed files with 13 additions and 0 deletions
+6
View File
@@ -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
+7
View File
@@ -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: