feluelle commented on a change in pull request #7671: [AIRFLOW-6574] Adding 
private_environment to docker operator.
URL: https://github.com/apache/airflow/pull/7671#discussion_r390270784
 
 

 ##########
 File path: tests/providers/docker/operators/test_docker.py
 ##########
 @@ -81,13 +83,25 @@ def test_execute(self, client_class_mock, tempdir_mock):
                                                                
auto_remove=False,
                                                                dns=None,
                                                                dns_search=None)
-        tempdir_mock.assert_called_once_with(dir='/host/airflow', 
prefix='airflowtmp')
+        tempdir_mock.assert_called_once_with(
+            dir='/host/airflow', prefix='airflowtmp')
         client_mock.images.assert_called_once_with(name='ubuntu:latest')
         client_mock.attach.assert_called_once_with(container='some_id', 
stdout=True,
                                                    stderr=True, stream=True)
         client_mock.pull.assert_called_once_with('ubuntu:latest', stream=True)
         client_mock.wait.assert_called_once_with('some_id')
 
+    def test_private_environment_is_private(self):
+        operator = DockerOperator(api_version='1.19', command='env', 
environment={'UNIT': 'TEST'},
+                                  private_environment={'PRIVATE': 'MESSAGE'}, 
image='ubuntu:latest',
+                                  network_mode='bridge', owner='unittest', 
task_id='unittest',
+                                  volumes=['/host/path:/container/path'],
+                                  working_dir='/container/path', shm_size=1000,
+                                  host_tmp_dir='/host/airflow', 
container_name='test_container',
+                                  tty=True)
+        self.assertEqual(getattr(operator, '_private_environment'), {
+                         'PRIVATE': 'MESSAGE'})
 
 Review comment:
   ```suggestion
           assert operator.private_environment == {'PRIVATE': 'MESSAGE'}
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to