Skip to content

Commit 3e84d24

Browse files
committed
feat(test): simpler test without callback
1 parent ccc9b4a commit 3e84d24

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

tests/catalog/test_rest.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
from requests.adapters import HTTPAdapter
2727
from requests.exceptions import HTTPError
2828
from requests_mock import Mocker
29-
from requests_mock.request import _RequestObjectProxy
30-
from requests_mock.response import _Context
3129

3230
import pyiceberg
3331
from pyiceberg.catalog import PropertiesUpdateSummary, load_catalog
@@ -1644,18 +1642,6 @@ def test_update_namespace_properties_invalid_namespace(rest_mock: Mocker) -> Non
16441642

16451643

16461644
def test_with_disabled_ssl_ca_bundle(rest_mock: Mocker) -> None:
1647-
from pydantic import ValidationError
1648-
1649-
def ssl_check_callback(req: _RequestObjectProxy, _: _Context) -> None:
1650-
if req.verify:
1651-
raise AssertionError("SSL verification is still enabled")
1652-
1653-
# Given
1654-
rest_mock.get(
1655-
f"{TEST_URI}v1/config",
1656-
json=ssl_check_callback,
1657-
status_code=200,
1658-
)
16591645
# Given
16601646
catalog_properties = {
16611647
"uri": TEST_URI,
@@ -1664,8 +1650,8 @@ def ssl_check_callback(req: _RequestObjectProxy, _: _Context) -> None:
16641650
"cabundle": False,
16651651
},
16661652
}
1667-
with pytest.raises(ValidationError) as _:
1668-
RestCatalog("rest", **catalog_properties) # type: ignore
1653+
catalog = RestCatalog("rest", **catalog_properties) # type: ignore
1654+
assert catalog._session.verify is False
16691655

16701656

16711657
def test_request_session_with_ssl_ca_bundle(monkeypatch: pytest.MonkeyPatch) -> None:

0 commit comments

Comments
 (0)