mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-07-13 11:22:14 +02:00
Feat/dybamic transfer (#521)
* feat: enable dynamic transfer destination resolution * fix: remove approved routes, policy and fallback * fix: review comments
This commit is contained in:
parent
aa04a41ff3
commit
2801c3156e
12 changed files with 1534 additions and 86 deletions
|
|
@ -1,3 +1,5 @@
|
|||
import pytest
|
||||
|
||||
from api.schemas.tool import TransferCallConfig
|
||||
|
||||
|
||||
|
|
@ -13,3 +15,28 @@ def test_transfer_call_destination_accepts_provider_specific_literal():
|
|||
config = TransferCallConfig(destination="provider-specific-destination")
|
||||
|
||||
assert config.destination == "provider-specific-destination"
|
||||
|
||||
|
||||
def test_transfer_call_static_requires_destination():
|
||||
with pytest.raises(ValueError, match="destination is required"):
|
||||
TransferCallConfig(destination_source="static", destination="")
|
||||
|
||||
|
||||
def test_transfer_call_dynamic_requires_resolver():
|
||||
with pytest.raises(ValueError, match="resolver is required"):
|
||||
TransferCallConfig(destination_source="dynamic", destination="")
|
||||
|
||||
|
||||
def test_transfer_call_dynamic_accepts_resolver_without_destination():
|
||||
config = TransferCallConfig(
|
||||
destination_source="dynamic",
|
||||
destination="",
|
||||
resolver={
|
||||
"type": "http",
|
||||
"url": "https://crm.example.com/resolve-transfer",
|
||||
},
|
||||
)
|
||||
|
||||
assert config.destination_source == "dynamic"
|
||||
assert config.destination == ""
|
||||
assert config.resolver is not None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue