Skip to content

Commit 2f56a35

Browse files
add unit test
1 parent e78c7f9 commit 2f56a35

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/catalog/test_rest.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,23 @@ def test_list_namespace_with_parent_200(rest_mock: Mocker) -> None:
554554
("accounting", "tax"),
555555
]
556556

557+
def test_list_namespace_with_parent_404(rest_mock: Mocker) -> None:
558+
rest_mock.get(
559+
f"{TEST_URI}v1/namespaces?parent=some_namespace",
560+
json={
561+
"error": {
562+
"message": "Namespace provided in the `parent` query parameter is not found",
563+
"type": "NoSuchNamespaceException",
564+
"code": 404,
565+
}
566+
},
567+
status_code=404,
568+
request_headers=TEST_HEADERS,
569+
)
570+
571+
with pytest.raises(NoSuchNamespaceError):
572+
RestCatalog("rest", uri=TEST_URI, token=TEST_TOKEN).list_namespaces(("some_namespace",))
573+
557574

558575
@pytest.mark.filterwarnings(
559576
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning"

0 commit comments

Comments
 (0)