예제 #1
0
def create_execution(service, status=models.Execution.PENDING):
    return models.Execution(service=service,
                            status=status,
                            workflow_name=WORKFLOW_NAME,
                            created_at=datetime.utcnow(),
                            started_at=datetime.utcnow(),
                            inputs={})
예제 #2
0
def test_existing_active_executions(request, service, model):
    existing_active_execution = models.Execution(
        service=service,
        status=models.Execution.STARTED,
        workflow_name='uninstall')
    model.execution.put(existing_active_execution)
    with pytest.raises(exceptions.ActiveExecutionsError):
        _get_preparer(request, 'install').prepare()
예제 #3
0
def test_existing_executions_but_no_active_ones(request, service, model):
    existing_terminated_execution = models.Execution(
        service=service,
        status=models.Execution.SUCCEEDED,
        workflow_name='uninstall')
    model.execution.put(existing_terminated_execution)
    # no active executions exist, so no error should be raised
    _get_preparer(request, 'install').prepare()