Example #1
0
def test_handle_pending_skip(workspace: Workspace,
                             mockpatch: MockPatcher) -> None:
    mockpatch(workspace, 'update_guest_state')

    assert workspace.handle_cancel() is workspace
    assert workspace.result is None
    cast(MagicMock, workspace.update_guest_state).assert_not_called()
Example #2
0
def test_handle_fail(workspace: Workspace, mockpatch: MockPatcher) -> None:
    mock_tail_handler = MagicMock(handle_tail=MagicMock(return_value=False))

    mockpatch(tft.artemis.tasks.update_guest_request,
              'ProvisioningTailHandler').return_value = mock_tail_handler

    assert workspace.handle_cancel() is workspace
    assert workspace.result is tft.artemis.tasks.RESCHEDULE
Example #3
0
def test_handle_cancel_skip(workspace: Workspace,
                            mockpatch: MockPatcher) -> None:
    mockpatch(tft.artemis.tasks.update_guest_request,
              'ProvisioningTailHandler')

    assert workspace.handle_cancel() is workspace
    assert workspace.result is None
    cast(
        MagicMock,
        tft.artemis.tasks.update_guest_request.
        ProvisioningTailHandler  # type: ignore[attr-defined]
    ).assert_not_called()