You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "bugraoz93 (via GitHub)" <gi...@apache.org> on 2024/12/01 13:14:46 UTC
Re: [PR] AIP-81 Implement POST/Insert Multiple Connections in REST API (FastAPI) [airflow]
bugraoz93 commented on code in PR #44531:
URL: https://github.com/apache/airflow/pull/44531#discussion_r1864890098
##########
tests/api_fastapi/core_api/routes/public/test_connections.py:
##########
@@ -298,6 +309,180 @@ def test_post_should_response_201_redacted_password(self, test_client, body, exp
assert response.json() == expected_response
+class TestPostConnections(TestConnectionEndpoint):
+ @pytest.mark.parametrize(
+ "body",
+ [
+ {
+ "connections": [
+ {"connection_id": TEST_CONN_ID, "conn_type": TEST_CONN_TYPE},
+ {"connection_id": TEST_CONN_ID_2, "conn_type": TEST_CONN_TYPE_2, "extra": None},
+ ]
+ },
+ {
+ "connections": [
+ {"connection_id": TEST_CONN_ID, "conn_type": TEST_CONN_TYPE, "extra": "{}"},
+ {
+ "connection_id": TEST_CONN_ID_2,
+ "conn_type": TEST_CONN_TYPE_2,
+ "extra": '{"key": "value"}',
+ },
+ {
+ "connection_id": TEST_CONN_ID_3,
+ "conn_type": TEST_CONN_ID_3,
+ "description": "test_description",
+ "host": "test_host",
+ "login": "test_login",
+ "schema": "test_schema",
+ "port": 8080,
+ "extra": '{"key": "value"}',
+ },
+ ]
+ },
+ ],
+ )
+ def test_post_should_respond_200(self, test_client, session, body):
Review Comment:
Thanks for the review! I adjusted the name for the POST single Connection test method too. It is 201 :smile:
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org