mik-laj commented on a change in pull request #9329:
URL: https://github.com/apache/airflow/pull/9329#discussion_r440981732
##########
File path: tests/api_connexion/endpoints/test_pool_endpoint.py
##########
@@ -141,3 +141,69 @@ def test_response_404(self):
},
response.json,
)
+
+
+class TestDeletePool(TestBasePoolEndpoints):
+ @provide_session
+ def test_response_204(self, session):
+ pool_name = "test_pool"
+ pool_instance = Pool(pool=pool_name, slots=3)
+ session.add(pool_instance)
+ session.commit()
+
+ response = self.client.delete(f"api/v1/pools/{pool_name}")
+ assert response.status_code == 204
+ # Check if the pool is deleted from the db
+ response = self.client.get(f"api/v1/pools/{pool_name}")
+ self.assertEqual(response.status_code, 404)
+
+ @provide_session
+ def test_response_404(self, session):
+ response = self.client.delete("api/v1/pools/invalid_pool")
+ self.assertEqual(response.status_code, 404)
+
+class TestPostPool(TestBasePoolEndpoints):
Review comment:
Can you also add a test that check handling for 400?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]