Files
speckle-automate-data-shield/tests/test_function.py
T
Jonathon Broughton 6322f38720
build and deploy Speckle functions / publish-automate-function-version (push) Has been cancelled
Refactor parameter actions and matching strategies
- Introduced a new `ParameterMatcher` class for flexible matching.
- Added `PrefixMatcher` and `PatternMatcher` subclasses for specific match logic.
- Updated `ParameterAction` to include a check method.
- Replaced old removal action with a more generic `RemovalAction`.
- Enhanced input schema to clarify sanitization modes and parameters.
- Improved documentation throughout the codebase.
2025-03-24 22:56:45 +00:00

30 lines
1018 B
Python

"""Run integration tests with a speckle server."""
from speckle_automate import (
AutomationContext,
AutomationRunData,
AutomationStatus,
run_function,
)
from speckle_automate.fixtures import *
from data_shield.function import FunctionInputs, SanitizationMode, automate_function
class TestFunction:
"""Test the automate function."""
def test_function_run(self, test_automation_run_data: AutomationRunData, test_automation_token: str) -> None:
"""Run an integration test for the automate function."""
automation_context = AutomationContext.initialize(test_automation_run_data, test_automation_token)
automate_sdk = run_function(
automation_context,
automate_function,
FunctionInputs(
sanitization_mode=SanitizationMode.PATTERN_MATCHING,
parameter_input="/.*?peckl.*/i",
strict_mode=True,
),
)
assert automate_sdk.run_status == AutomationStatus.SUCCEEDED