コード例 #1
0
ファイル: test_cloud_environment.py プロジェクト: ii0/prefect
def test_execute(monkeypatch):
    environment = CloudEnvironment()
    storage = Docker(registry_url="test1", image_name="test2", image_tag="test3")

    create_flow_run = MagicMock()
    monkeypatch.setattr(
        "prefect.environments.CloudEnvironment.create_flow_run_job", create_flow_run
    )

    environment.execute(storage=storage, flow_location="")

    assert create_flow_run.call_args[1]["docker_name"] == "test1/test2:test3"
コード例 #2
0
def test_execute_storage_missing_fields():
    environment = CloudEnvironment()
    with pytest.raises(ValueError):
        environment.execute(storage=Docker(), flow_location="")
コード例 #3
0
def test_execute_improper_storage():
    environment = CloudEnvironment()
    with pytest.raises(TypeError):
        environment.execute(storage=Memory(), flow_location="")