From 7832787b84cf4928bb1f1828a1268b6e36e6e5ef Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Wed, 4 Feb 2026 13:36:43 +0100 Subject: [PATCH] Improve tests --- .../test-stack-reusable-workflow.yml | 2 +- .../tests/plugins/test_processor.py | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 changedetectionio/tests/plugins/test_processor.py diff --git a/.github/workflows/test-stack-reusable-workflow.yml b/.github/workflows/test-stack-reusable-workflow.yml index 182c8b560..9ece4f6b1 100644 --- a/.github/workflows/test-stack-reusable-workflow.yml +++ b/.github/workflows/test-stack-reusable-workflow.yml @@ -416,7 +416,7 @@ jobs: - name: Basic processor plugin registration and checks run: | - docker run -e EXTRA_PACKAGES=changedetection.io-osint-processor test-changedetectionio bash -c 'python3 -m unittest changedetectionio.tests.unit.test_notification_diff' + docker run -e EXTRA_PACKAGES=changedetection.io-osint-processor test-changedetectionio bash -c 'cd changedetectionio;pytest -vvv -s tests/plugins/test_processor.py' # Container startup tests container-tests: diff --git a/changedetectionio/tests/plugins/test_processor.py b/changedetectionio/tests/plugins/test_processor.py new file mode 100644 index 000000000..58a445d0c --- /dev/null +++ b/changedetectionio/tests/plugins/test_processor.py @@ -0,0 +1,30 @@ +from flask import url_for + +from changedetectionio.tests.util import wait_for_all_checks + + +def test_check_plugin_processor(client, live_server, measure_memory_usage, datastore_path): + # requires os-int intelligence plugin installed (first basic one we test with) + + res = client.get(url_for("watchlist.index")) + assert b'OSINT Reconnaissance' in res.data + + assert b'' in res.data, "But the first text_json_diff processor should always be selected by default in quick watch form" + + res = client.post( + url_for("ui.ui_views.form_quick_watch_add"), + data={"url": 'http://127.0.0.1', "tags": '', 'processor': 'osint_recon'}, + follow_redirects=True + ) + assert b"Watch added" in res.data + client.get(url_for("ui.form_watch_checknow"), follow_redirects=True) + + wait_for_all_checks(client) + + res = client.get( + url_for("ui.ui_preview.preview_page", uuid="first"), + follow_redirects=True + ) + + assert b'Target: http://127.0.0.1' in res.data + assert b'DNSKEY Records' in res.data \ No newline at end of file