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 2020/06/19 15:21:24 UTC

[GitHub] [airflow] mik-laj commented on a change in pull request #9266: Add CRUD endpoint for connections

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



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

Review comment:
       It's a immutable fields.
   ```
   When a service receives an immutable field in an update request (or similar), even if included in the update mask, the service should ignore the field if the value matches, but should error with INVALID_ARGUMENT if a change is requested.
   ```




----------------------------------------------------------------
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:
users@infra.apache.org