mik-laj commented on a change in pull request #9266:
URL: https://github.com/apache/airflow/pull/9266#discussion_r442902437



##########
File path: tests/api_connexion/endpoints/test_connection_endpoint.py
##########
@@ -200,14 +229,143 @@ def _create_connections(self, count):
 
 
 class TestPatchConnection(TestConnectionEndpoint):
-    @unittest.skip("Not implemented yet")
-    def test_should_response_200(self):
-        response = self.client.patch("/api/v1/connections/1")
+
+    @provide_session
+    def test_patch_should_response_200(self, session):
+        self._create_connection(session)
+        payload = {
+            "connection_id": "test-connection-id",
+            "conn_type": 'test_type',
+            "extra": "{'key': 'var'}"
+        }
+        response = self.client.patch("/api/v1/connections/test-connection-id",
+                                     json=payload)
+        assert response.status_code == 200
+
+    @provide_session
+    def test_patch_should_response_200_with_update_mask(self, session):
+        self._create_connection(session)
+        test_connection = "test-connection"
+        payload = {
+            "connection_id": test_connection,
+            "conn_type": 'test_type_2',
+            "extra": "{'key': 'var'}",
+            'login': "login",
+            "port": 80,
+            "_password": 'password',
+            'nan': 'asdf'
+        }
+        response = self.client.patch(
+            "/api/v1/connections/test-connection-id?update_mask=port,login, 
connection_id, _password",

Review comment:
       Unsupported fields in the mask should result in an INVALID_ARGUMENT 
exception. This avoids typos.




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


Reply via email to