ashb commented on a change in pull request #4938: [AIRFLOW-4117] Multi-staging 
Image - Travis CI tests [Step 3/3]
URL: https://github.com/apache/airflow/pull/4938#discussion_r299380624
 
 

 ##########
 File path: tests/contrib/hooks/test_sftp_hook.py
 ##########
 @@ -25,14 +25,29 @@
 
 from airflow.contrib.hooks.sftp_hook import SFTPHook
 from airflow.models import Connection
+from airflow.utils.db import provide_session
 
 TMP_PATH = '/tmp'
 TMP_DIR_FOR_TESTS = 'tests_sftp_hook_dir'
 TMP_FILE_FOR_TESTS = 'test_file.txt'
 
+SFTP_CONNECTION_USER = "root"
+
 
 class SFTPHookTest(unittest.TestCase):
+
+    @provide_session
+    def update_connection(self, login, session=None):
+        connection = (session.query(Connection).
+                      filter(Connection.conn_id == "sftp_default")
+                      .first())
+        old_login = connection.login
+        connection.login = login
+        session.commit()
+        return old_login
 
 Review comment:
   This seems like it is entirely unrelated to _how_ we run the CI and 
shouldn't be needed in this PR

----------------------------------------------------------------
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