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


##########
task_sdk/tests/api/test_client.py:
##########
@@ -133,3 +134,21 @@ def handle_request(request: httpx.Request) -> 
httpx.Response:
                 "reason": "not_found",
             }
         }
+
+    def test_variable_put_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=200,
+                    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", type="PutVariable"

Review Comment:
   Not really, it can be str normally unlike with XCOMs. 
   ```
   class VariablePostBody(BaseModel):
       """Request body schema for creating variables."""
   
       value: str | None = Field(serialization_alias="val")
       description: str | None = Field(default=None)
   ```



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