Skip to content

Commit d91041a

Browse files
committed
fixup! ✨(backend) add metadata collection of VAD, connection and chat events
1 parent d30e598 commit d91041a

1 file changed

Lines changed: 18 additions & 12 deletions

File tree

src/backend/core/tests/rooms/test_api_rooms_start_recording.py

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,10 @@ def test_start_recording_calls_metadata_collector_start(
510510

511511
response = client.post(
512512
f"/api/v1.0/rooms/{room.id}/start-recording/",
513-
{"mode": "screen_recording", "options": {"transcribe": True}},
513+
{
514+
"mode": "screen_recording",
515+
"options": {"transcribe": True, "collect_metadata": True},
516+
},
514517
format="json",
515518
)
516519

@@ -521,20 +524,25 @@ def test_start_recording_calls_metadata_collector_start(
521524

522525

523526
@pytest.mark.parametrize(
524-
"metadata_enabled,transcribe",
527+
"metadata_enabled,options",
525528
[
526-
(False, True),
527-
(False, False),
528-
(True, False),
529+
# Metadata collector disabled, regardless of transcribe option
530+
(False, {"transcribe": True}),
531+
(False, {"transcribe": False}),
532+
(False, None),
533+
# Metadata collector enabled, but transcribe is False or missing
534+
(True, {"transcribe": False}),
529535
(True, None),
536+
# Metadata collector enabled, transcribe True, but collect_metadata explicitly False
537+
(True, {"transcribe": True, "collect_metadata": False}),
530538
],
531539
)
532540
def test_start_recording_does_not_call_metadata_collector_start_when_conditions_not_met(
533541
settings,
534542
mock_worker_service_factory,
535543
mock_worker_manager,
536544
metadata_enabled,
537-
transcribe,
545+
options,
538546
):
539547
"""Should not call MetadataCollectorService.start when conditions are not met."""
540548
settings.RECORDING_ENABLE = True
@@ -547,9 +555,9 @@ def test_start_recording_does_not_call_metadata_collector_start_when_conditions_
547555
client = APIClient()
548556
client.force_login(user)
549557

550-
options = {}
551-
if transcribe is not None:
552-
options["transcribe"] = transcribe
558+
payload = {"mode": "screen_recording"}
559+
if options is not None:
560+
payload["options"] = options
553561

554562
with mock.patch(
555563
"core.api.viewsets.MetadataCollectorService"
@@ -559,9 +567,7 @@ def test_start_recording_does_not_call_metadata_collector_start_when_conditions_
559567

560568
response = client.post(
561569
f"/api/v1.0/rooms/{room.id}/start-recording/",
562-
{"mode": "screen_recording", "options": options}
563-
if options
564-
else {"mode": "screen_recording"},
570+
payload,
565571
format="json",
566572
)
567573

0 commit comments

Comments
 (0)