kaxil commented on a change in pull request #6376: [AIRFLOW-5705] Add secrets 
backend and support for AWS SSM
URL: https://github.com/apache/airflow/pull/6376#discussion_r393586367
 
 

 ##########
 File path: tests/providers/amazon/aws/secrets/test_ssm.py
 ##########
 @@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+from unittest import mock
+
+from airflow.providers.amazon.aws.secrets.ssm import AwsSsmSecretsBackend
+
+
[email protected]("airflow.providers.amazon.aws.secrets.ssm.AwsSsmSecretsBackend.get_conn_uri")
+def test_aws_ssm_get_connections(mock_get_uri):
+    mock_get_uri.side_effect = ["scheme://user:pass@host:100"]
+    conn_list = AwsSsmSecretsBackend().get_connections("fake_conn")
+    conn = conn_list[0]
+    assert conn.host == 'host'
 
 Review comment:
   This test has an incorrect side_effect. The Mock object 
`AwsSsmSecretsBackend.get_conn_uri` returns a string and not a list.
   
   Raised a PR to fix that: https://github.com/apache/airflow/pull/7745
   
   

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to