Some tidyup
Some checks are pending
Publish Python 🐍distribution 📦 to PyPI and TestPyPI / Build distribution 📦 (push) Waiting to run
Publish Python 🐍distribution 📦 to PyPI and TestPyPI / Test the built 📦 package works basically. (push) Blocked by required conditions
Publish Python 🐍distribution 📦 to PyPI and TestPyPI / Publish Python 🐍 distribution 📦 to PyPI (push) Blocked by required conditions
ChangeDetection.io App Test / lint-code (push) Waiting to run
ChangeDetection.io App Test / test-application-3-10 (push) Blocked by required conditions
ChangeDetection.io App Test / test-application-3-11 (push) Blocked by required conditions
ChangeDetection.io App Test / test-application-3-12 (push) Blocked by required conditions
ChangeDetection.io App Test / test-application-3-13 (push) Blocked by required conditions

This commit is contained in:
dgtlmoon
2025-03-13 23:58:18 +01:00
parent 0c68cfffb1
commit 987ab3e494
2 changed files with 2 additions and 12 deletions

View File

@@ -13,13 +13,9 @@ def register_operators():
def ends_with(_, text, suffix):
return text.lower().strip().endswith(suffix.lower())
def extracted_number(_, text, suffix):
return 1
return {
"starts_with": starts_with,
"ends_with": ends_with,
"extracted_number": extracted_number
"ends_with": ends_with
}
@hookimpl
@@ -42,7 +38,6 @@ def register_field_choices():
@hookimpl
def add_data(current_watch_uuid, application_datastruct, ephemeral_data):
res = {}
if 'text' in ephemeral_data:
res['page_text'] = ephemeral_data['text']
@@ -53,5 +48,4 @@ def add_data(current_watch_uuid, application_datastruct, ephemeral_data):
res['extracted_number'] = float(price.amount)
logger.debug(f"Extracted price result: '{price}' - returning float({res['extracted_number']})")
return res

View File

@@ -1,13 +1,8 @@
from changedetectionio.conditions import execute_ruleset_against_all_plugins
from changedetectionio.model import Watch
from changedetectionio.store import ChangeDetectionStore
import os
import re
import shutil
import tempfile
import time
import time
import unittest
import unittest
import uuid
@@ -69,6 +64,7 @@ class TestTriggerConditions(unittest.TestCase):
{"operator": ">=", "field": "extracted_number", "value": "10"},
{"operator": "<=", "field": "extracted_number", "value": "5000"},
{"operator": "in", "field": "page_text", "value": "rock"},
#{"operator": "starts_with", "field": "page_text", "value": "I saw"},
]
}
)