mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-13 08:15:21 +02:00
feat: refactor node spec and add mcp tools (#244)
* refactor: carve out extraction panel * refactor: create spec versions for node types * refactor: create a GenericNode and remove custom nodes * feat: add python and typescript sdk * add dograh sdk * fix: fetch draft workflow definition over published one * fix: fix routes of SDKs to use code gen * chore: remove doclink dependency to reduce image size * chore: format files * chore: bump pipecat * feat: let mcp fetch archived workflows on demand * chore: fix tests * feat: add sdk documentation * chore: change banner and add badge
This commit is contained in:
parent
0a61ef295f
commit
00a1a22b74
162 changed files with 14355 additions and 3554 deletions
39
api/tests/test_display_options_evaluator.py
Normal file
39
api/tests/test_display_options_evaluator.py
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
"""Golden-test parity for the display_options evaluator.
|
||||
|
||||
Both the Python `evaluate_display_options` and the TypeScript
|
||||
`evaluateDisplayOptions` (in `ui/src/components/flow/renderer/displayOptions.ts`)
|
||||
must agree on every fixture in `display_options_fixtures.json`. The TS
|
||||
side is verified by `ui/scripts/test-display-options.mjs`.
|
||||
"""
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from api.services.workflow.node_specs import evaluate_display_options
|
||||
|
||||
FIXTURES_PATH = (
|
||||
Path(__file__).parent.parent
|
||||
/ "services"
|
||||
/ "workflow"
|
||||
/ "node_specs"
|
||||
/ "display_options_fixtures.json"
|
||||
)
|
||||
|
||||
|
||||
def load_cases():
|
||||
with open(FIXTURES_PATH) as f:
|
||||
return json.load(f)["cases"]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", load_cases(), ids=lambda c: c["name"])
|
||||
def test_python_evaluator_matches_fixture(case):
|
||||
rules = case["rules"]
|
||||
values = case["values"]
|
||||
expected = case["expected"]
|
||||
actual = evaluate_display_options(rules, values)
|
||||
assert actual is expected, (
|
||||
f"{case['name']}: expected {expected}, got {actual} "
|
||||
f"for rules={rules!r} values={values!r}"
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue