예제 #1
0
    def test_all_containers_is_replaced(self, monkeypatch):
        task = ListContainers(all_containers=False)

        api = MagicMock()
        monkeypatch.setattr("docker.APIClient", api)

        task.run(all_containers=True)
        assert api.return_value.containers.call_args[1]["all"]
예제 #2
0
    def test_all_containers_run_value_is_used(self, monkeypatch):
        task = ListContainers()

        api = MagicMock()
        monkeypatch.setattr("prefect.tasks.docker.containers.docker.APIClient",
                            api)

        task.run(all_containers=True)
        assert api.return_value.containers.call_args[1]["all"]