示例#1
0
def test_docker_agent_parse_volume_spec_raises_on_invalid_spec(
    api, candidate, exception_type
):
    agent = DockerAgent()

    with pytest.raises(exception_type):
        agent._parse_volume_spec([candidate])
示例#2
0
def test_docker_agent_parse_volume_spec_raises_on_invalid_spec(
        monkeypatch, cloud_api, candidate, exception_type):
    api = MagicMock()
    monkeypatch.setattr(
        "prefect.agent.docker.agent.DockerAgent._get_docker_client",
        MagicMock(return_value=api),
    )

    agent = DockerAgent()

    with pytest.raises(exception_type):
        agent._parse_volume_spec([candidate])