mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-07-25 12:01:04 +02:00
fix: move draft and template context handling out of create_workflow_run (#560)
* fix: move draft and template context handling out of create_workflow_run create_workflow_run now only creates the run with the definition_id and initial_context provided by the caller. Test call paths explicitly resolve draft definitions and merge template context variables before creating the run, while production/runtime paths bind the published definition without adding template defaults. * fix: review comments * chore: format and minor cleanups --------- Co-authored-by: Abhishek Kumar <abhishek@a6k.me>
This commit is contained in:
parent
94dce42209
commit
90c5831984
19 changed files with 657 additions and 72 deletions
|
|
@ -281,7 +281,7 @@ class TestDispatcherThreadsTelephonyConfig:
|
|||
),
|
||||
),
|
||||
):
|
||||
mock_db.get_workflow_by_id = AsyncMock(return_value=SimpleNamespace(id=1))
|
||||
mock_db.get_workflow = AsyncMock(return_value=SimpleNamespace(id=1))
|
||||
mock_db.create_workflow_run = AsyncMock(return_value=workflow_run)
|
||||
mock_db.update_workflow_run = AsyncMock()
|
||||
mock_concurrency.bind_workflow_run = AsyncMock()
|
||||
|
|
@ -300,6 +300,11 @@ class TestDispatcherThreadsTelephonyConfig:
|
|||
)
|
||||
await dispatcher.dispatch_call(queued_run, campaign, slot)
|
||||
|
||||
mock_db.get_workflow.assert_awaited_once_with(
|
||||
campaign.workflow_id,
|
||||
organization_id=org_id,
|
||||
)
|
||||
|
||||
# acquire_from_number on rate_limiter must be called with the
|
||||
# campaign's telephony_configuration_id.
|
||||
assert mock_rl.acquire_from_number.await_count == 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue