You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ka...@apache.org on 2020/08/25 11:58:11 UTC

[airflow] branch master updated: Fix failing Black test on connexion (#10547)

This is an automated email from the ASF dual-hosted git repository.

kaxilnaik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/master by this push:
     new 4c6b759  Fix failing Black test on connexion (#10547)
4c6b759 is described below

commit 4c6b7595de65d6a8652becb714319f92a4fd52eb
Author: Kaxil Naik <ka...@gmail.com>
AuthorDate: Tue Aug 25 12:57:07 2020 +0100

    Fix failing Black test on connexion (#10547)
---
 tests/api_connexion/endpoints/test_dag_endpoint.py | 43 +++++++++-------------
 1 file changed, 18 insertions(+), 25 deletions(-)

diff --git a/tests/api_connexion/endpoints/test_dag_endpoint.py b/tests/api_connexion/endpoints/test_dag_endpoint.py
index c875a14..d89fd85 100644
--- a/tests/api_connexion/endpoints/test_dag_endpoint.py
+++ b/tests/api_connexion/endpoints/test_dag_endpoint.py
@@ -359,7 +359,7 @@ class TestPatchDag(TestDagEndpoint):
         response = self.client.patch(
             f"/api/v1/dags/{dag_model.dag_id}?update_mask=is_paused",
             json=payload,
-            environ_overrides={'REMOTE_USER': "test"}
+            environ_overrides={'REMOTE_USER': "test"},
         )
         self.assertEqual(response.status_code, 200)
         expected_response = {
@@ -370,39 +370,32 @@ class TestPatchDag(TestDagEndpoint):
             "is_subdag": False,
             "owners": [],
             "root_dag_id": None,
-            "schedule_interval": {
-                "__type": "CronExpression",
-                "value": "2 2 * * *",
-            },
+            "schedule_interval": {"__type": "CronExpression", "value": "2 2 * * *",},
             "tags": [],
         }
         self.assertEqual(response.json, expected_response)
 
-    @parameterized.expand([
-        (
-            {
-                "is_paused": True,
-            },
-            "update_mask=description",
-            "Only `is_paused` field can be updated through the REST API"
-        ),
-        (
-            {
-                "is_paused": True,
-            },
-            "update_mask=schedule_interval, description",
-            "Only `is_paused` field can be updated through the REST API"
-        )
-    ])
-    def test_should_response_400_for_invalid_fields_in_update_mask(
-        self, payload, update_mask, error_message
-    ):
+    @parameterized.expand(
+        [
+            (
+                {"is_paused": True,},
+                "update_mask=description",
+                "Only `is_paused` field can be updated through the REST API",
+            ),
+            (
+                {"is_paused": True,},
+                "update_mask=schedule_interval, description",
+                "Only `is_paused` field can be updated through the REST API",
+            ),
+        ]
+    )
+    def test_should_response_400_for_invalid_fields_in_update_mask(self, payload, update_mask, error_message):
         dag_model = self._create_dag_model()
 
         response = self.client.patch(
             f"/api/v1/dags/{dag_model.dag_id}?{update_mask}",
             json=payload,
-            environ_overrides={'REMOTE_USER': "test"}
+            environ_overrides={'REMOTE_USER': "test"},
         )
         self.assertEqual(response.status_code, 400)
         self.assertEqual(response.json['detail'], error_message)