sungwy commented on code in PR #1242: URL: https://github.com/apache/iceberg-python/pull/1242#discussion_r1822580115
########## tests/catalog/test_rest.py: ########## @@ -450,6 +450,28 @@ def test_list_views_404(rest_mock: Mocker) -> None: assert "Namespace does not exist" in str(e.value) +def test_view_exists_204(rest_mock: Mocker) -> None: + namespace = "examples" + view = "some_view" + rest_mock.head( + f"{TEST_URI}v1/namespaces/{namespace}/views/{view}", + status_code=204, + request_headers=TEST_HEADERS, + ) + catalog = RestCatalog("rest", uri=TEST_URI, token=TEST_TOKEN) + assert catalog.view_exists((namespace, view)) + +def test_view_exists_404(rest_mock: Mocker) -> None: + namespace = "examples" + view = "some_view" + rest_mock.head( + f"{TEST_URI}v1/namespaces/{namespace}/views/{view}", Review Comment: Could we add a test case here for a multi-level namespace as well? -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org