amoghrajesh commented on code in PR #44562:
URL: https://github.com/apache/airflow/pull/44562#discussion_r1869517467


##########
task_sdk/tests/api/test_client.py:
##########
@@ -133,3 +134,19 @@ def handle_request(request: httpx.Request) -> 
httpx.Response:
                 "reason": "not_found",
             }
         }
+
+    def test_variable_set_success(self):
+        # Simulate a successful response from the server when putting a 
variable
+        def handle_request(request: httpx.Request) -> httpx.Response:
+            if request.url.path == "/variables/test_key":
+                return httpx.Response(
+                    status_code=201,
+                    json={"message": "Variable successfully set"},
+                )
+            return httpx.Response(status_code=400, json={"detail": "Bad 
Request"})
+
+        client = make_client(transport=httpx.MockTransport(handle_request))
+
+        msg = PutVariable(key="test_key", value="test_value", 
description="test_description")
+        result = client.variables.set(msg=msg)

Review Comment:
   Handled it



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to