This is an automated email from the ASF dual-hosted git repository.
henry3260 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 7790df7e2d4 add test_create_default and test_update in
test_operations.py (#71301)
7790df7e2d4 is described below
commit 7790df7e2d4617865187b2f07632d00699a91f1e
Author: Pratiksha Badheka <[email protected]>
AuthorDate: Sat Aug 8 17:16:16 2026 +0530
add test_create_default and test_update in test_operations.py (#71301)
---
.../tests/airflow_ctl/api/test_operations.py | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/airflow-ctl/tests/airflow_ctl/api/test_operations.py
b/airflow-ctl/tests/airflow_ctl/api/test_operations.py
index 952068c86aa..1bc183d4f45 100644
--- a/airflow-ctl/tests/airflow_ctl/api/test_operations.py
+++ b/airflow-ctl/tests/airflow_ctl/api/test_operations.py
@@ -86,6 +86,7 @@ from airflowctl.api.datamodels.generated import (
PluginResponse,
PoolBody,
PoolCollectionResponse,
+ PoolPatchBody,
PoolResponse,
ProviderCollectionResponse,
ProviderResponse,
@@ -831,6 +832,16 @@ class TestConnectionsOperations:
response = client.connections.bulk(connections=connection_bulk_body)
assert response == self.connection_bulk_response
+ def test_create_defaults(self):
+ def handle_request(request: httpx.Request) -> httpx.Response:
+ assert request.url.path == "/api/v2/connections/defaults"
+ assert request.method == "POST"
+ return httpx.Response(200, json={})
+
+ client = make_api_client(transport=httpx.MockTransport(handle_request))
+ response = client.connections.create_defaults()
+ assert response is None
+
def test_delete(self):
def handle_request(request: httpx.Request) -> httpx.Response:
assert request.url.path ==
f"/api/v2/connections/{self.connection_id}"
@@ -1636,6 +1647,7 @@ class TestPoolsOperations:
pools=[pool_response],
total_entries=1,
)
+ pool_patch_body = PoolPatchBody(pool=pool_name, description="description")
pool_bulk_response = BulkResponse(
create=BulkActionResponse(success=[pool_name], errors=[]),
update=None,
@@ -1687,6 +1699,16 @@ class TestPoolsOperations:
response = client.pools.delete(self.pool_name)
assert response == self.pool_name
+ def test_update(self):
+ def handle_request(request: httpx.Request) -> httpx.Response:
+ assert request.url.path == f"/api/v2/pools/{self.pool_name}"
+ assert request.method == "PATCH"
+ return httpx.Response(200,
json=json.loads(self.pool_response.model_dump_json()))
+
+ client = make_api_client(transport=httpx.MockTransport(handle_request))
+ response = client.pools.update(pool_body=self.pool_patch_body)
+ assert response == self.pool_response
+
class TestProvidersOperations:
provider_response = ProviderResponse(