mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-07-25 12:01:04 +02:00
fix: review comments
This commit is contained in:
parent
a2f1c670aa
commit
28fc1953d5
6 changed files with 273 additions and 15 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