Skip to content

Commit 461a9d7

Browse files
add unit test
1 parent e78c7f9 commit 461a9d7

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/catalog/test_rest.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,24 @@ def test_list_namespace_with_parent_200(rest_mock: Mocker) -> None:
555555
]
556556

557557

558+
def test_list_namespace_with_parent_404(rest_mock: Mocker) -> None:
559+
rest_mock.get(
560+
f"{TEST_URI}v1/namespaces?parent=some_namespace",
561+
json={
562+
"error": {
563+
"message": "Namespace provided in the `parent` query parameter is not found",
564+
"type": "NoSuchNamespaceException",
565+
"code": 404,
566+
}
567+
},
568+
status_code=404,
569+
request_headers=TEST_HEADERS,
570+
)
571+
572+
with pytest.raises(NoSuchNamespaceError):
573+
RestCatalog("rest", uri=TEST_URI, token=TEST_TOKEN).list_namespaces(("some_namespace",))
574+
575+
558576
@pytest.mark.filterwarnings(
559577
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning"
560578
)

0 commit comments

Comments
 (0)