You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/01/12 17:12:43 UTC

[GitHub] mik-laj commented on a change in pull request #3684: [AIRFLOW-2840] - add update connections cli option

mik-laj commented on a change in pull request #3684: [AIRFLOW-2840] - add update connections cli option
URL: https://github.com/apache/airflow/pull/3684#discussion_r247319157
 
 

 ##########
 File path: tests/core.py
 ##########
 @@ -1248,75 +1258,166 @@ def test_cli_connections_add_delete(self):
             cli.connections(self.parser.parse_args(
                 ['connections', '-a', '--conn_id=new6',
                  '--conn_uri', "", '--conn_type=google_cloud_platform', '--conn_extra', "{'extra': 'yes'}"]))
+            cli.connections(self.parser.parse_args(
+                ['connections', '--add', '--conn_id=duplicate1',
+                 '--conn_uri=%s' % uri, '--conn_extra', "{'extra': 'yes'}"]))
+            cli.connections(self.parser.parse_args(
+                ['connections', '-a', '--conn_id=duplicate1',
+                 '--conn_uri=%s' % uri, '--conn_extra', "{'extra': 'yes'}"]))
             stdout = mock_stdout.getvalue()
 
         # Check addition stdout
         lines = [l for l in stdout.split('\n') if len(l) > 0]
+
         self.assertListEqual(lines, [
-            ("\tSuccessfully added `conn_id`=new1 : " +
-             "postgresql://airflow:airflow@host:5432/airflow"),
-            ("\tSuccessfully added `conn_id`=new2 : " +
-             "postgresql://airflow:airflow@host:5432/airflow"),
-            ("\tSuccessfully added `conn_id`=new3 : " +
-             "postgresql://airflow:airflow@host:5432/airflow"),
-            ("\tSuccessfully added `conn_id`=new4 : " +
-             "postgresql://airflow:airflow@host:5432/airflow"),
-            ("\tSuccessfully added `conn_id`=new5 : " +
-             "hive_metastore://airflow:airflow@host:9083/airflow"),
-            ("\tSuccessfully added `conn_id`=new6 : " +
-             "google_cloud_platform://:@:")
+            "Successfully added `conn_id`=new1 : postgres://airflow:airflow@host:5432/airflow",
+            "Successfully added `conn_id`=new2 : postgres://airflow:airflow@host:5432/airflow",
+            "Successfully added `conn_id`=new3 : postgres://airflow:airflow@host:5432/airflow",
+            "Successfully added `conn_id`=new4 : postgres://airflow:airflow@host:5432/airflow",
+            "Successfully added `conn_id`=new5 : hive_metastore://airflow:airflow@host:9083/airflow",
+            "Successfully added `conn_id`=new6 : google_cloud_platform://:@:",
 
 Review comment:
   According to the "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax" specification, this is not a valid address.
   Schema part must be compatible with the format:
   ````
         scheme      = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
   ````
   I created a issue https://issues.apache.org/jira/browse/AIRFLOW-3616  and working on PR: https://github.com/PolideaInternal/airflow/pull/30 
   which deals with this topic.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services