mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-07-16 11:31:04 +02:00
fix: error on empty destination when creating a default transfer tool
This commit is contained in:
parent
6d1051757c
commit
50e3c8c281
3 changed files with 7 additions and 9 deletions
|
|
@ -266,10 +266,6 @@ class TransferCallConfig(BaseModel):
|
|||
|
||||
@model_validator(mode="after")
|
||||
def validate_destination_source_config(self):
|
||||
if self.destination_source == "static" and not self.destination.strip():
|
||||
raise ValueError(
|
||||
"config.destination is required when destination_source is static"
|
||||
)
|
||||
if self.destination_source == "dynamic" and self.resolver is None:
|
||||
raise ValueError(
|
||||
"config.resolver is required when destination_source is dynamic"
|
||||
|
|
|
|||
|
|
@ -17,9 +17,11 @@ def test_transfer_call_destination_accepts_provider_specific_literal():
|
|||
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_static_allows_empty_draft_destination():
|
||||
config = TransferCallConfig(destination_source="static", destination="")
|
||||
|
||||
assert config.destination_source == "static"
|
||||
assert config.destination == ""
|
||||
|
||||
|
||||
def test_transfer_call_dynamic_requires_resolver():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue