dirrao commented on code in PR #39464:
URL: https://github.com/apache/airflow/pull/39464#discussion_r1593293779
##########
tests/providers/docker/operators/test_docker_swarm.py:
##########
@@ -254,3 +255,41 @@ def test_container_resources(self, types_mock,
docker_api_client_patcher):
placement=None,
)
types_mock.Resources.assert_not_called()
+
+ @mock.patch("airflow.providers.docker.operators.docker_swarm.types")
+ def test_service_args(self, types_mock, docker_api_client_patcher):
+ mock_obj = mock.Mock()
+
+ client_mock = mock.Mock(spec=APIClient)
+ client_mock.create_service.return_value = {"ID": "some_id"}
+ client_mock.images.return_value = []
+ client_mock.pull.return_value = [b'{"status":"pull log"}']
+ client_mock.tasks.return_value = [{"Status": {"State": "complete"}}]
+ types_mock.TaskTemplate.return_value = mock_obj
+ types_mock.ContainerSpec.return_value = mock_obj
+ types_mock.RestartPolicy.return_value = mock_obj
+ types_mock.Resources.return_value = mock_obj
+
+ docker_api_client_patcher.return_value = client_mock
+
+ operator = DockerSwarmOperator(
+ image="ubuntu:latest",
+ command="env",
+ args="--show",
Review Comment:
Can you add the test case with list as well?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]