Ejemplo n.º 1
0
def test_dispatch_followup_pending(workspace: Workspace,
                                   mockpatch: MockPatcher) -> None:
    mockpatch(workspace, 'dispatch_task')
    mockpatch(workspace, 'ungrab_guest_request')

    assert workspace.dispatch_followup() is workspace

    cast(MagicMock, workspace.dispatch_task).assert_called_once_with(
        update_guest_request,
        workspace.guestname,
        delay=workspace.provisioning_progress.delay_update)

    cast(MagicMock, workspace.ungrab_guest_request).assert_not_called()
Ejemplo n.º 2
0
def test_dispatch_followup_preparing(workspace: Workspace,
                                     mockpatch: MockPatcher) -> None:
    mockpatch(tft.artemis.tasks.update_guest_request,
              'dispatch_preparing_pre_connect')
    mockpatch(workspace, 'ungrab_guest_request')

    assert workspace.dispatch_followup() is workspace

    cast(
        MagicMock,
        tft.artemis.tasks.update_guest_request.
        dispatch_preparing_pre_connect  # type: ignore[attr-defined]
    ).assert_called_once_with(workspace.logger, workspace)

    cast(MagicMock, workspace.ungrab_guest_request).assert_not_called()