pierrejeambrun commented on code in PR #43825:
URL: https://github.com/apache/airflow/pull/43825#discussion_r1840464639
##########
tests/api_fastapi/core_api/routes/public/test_assets.py:
##########
@@ -229,3 +231,41 @@ def test_should_respect_page_size_limit_default(self,
test_client):
assert response.status_code == 200
assert len(response.json()["assets"]) == 100
+
+
+class TestGetAssetEndpoint(TestAssets):
+ @pytest.mark.parametrize(
+ "url",
+ [
+ urllib.parse.quote(
+ "s3://bucket/key/1", safe=""
+ ), # api should cover raw as well as unquoted case like legacy
+ "s3://bucket/key/1",
+ ],
+ )
+ @provide_session
+ def test_should_respond_200(self, test_client, url, session):
+ self.create_assets(num=1)
+ assert session.query(AssetModel).count() == 1
+ tz_datetime_format = self.default_time.replace("+00:00", "Z")
+ response = test_client.get(
+ f"/public/assets/{url}",
+ )
+ assert response.status_code == 200
Review Comment:
I think the original tests had an additional `assert_queries_count`. That's
a good thing to keep, helps detect removal of loading options for instance.
--
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]