Skip to content

Commit 441a18d

Browse files
Gayathri Srividya RajavarapuGayathri Srividya Rajavarapu
authored andcommitted
fix: update test_rest and add python version file
1 parent b169928 commit 441a18d

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.11.9

tests/catalog/test_rest.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3285,9 +3285,9 @@ def test_rest_catalog_with_basic_auth_flat_properties(rest_mock: Mocker) -> None
32853285
assert rest_mock.last_request.headers["Authorization"] == expected_auth_header
32863286

32873287

3288-
32893288
import pytest
32903289

3290+
32913291
@pytest.mark.parametrize(
32923292
"catalog_properties, token_response, expected_scopes",
32933293
[
@@ -3341,9 +3341,11 @@ def test_rest_catalog_with_basic_auth_flat_properties(rest_mock: Mocker) -> None
33413341
None,
33423342
["scopeA", "scopeB"],
33433343
),
3344-
]
3344+
],
33453345
)
3346-
def test_rest_catalog_with_flat_properties_edge_cases(requests_mock, rest_mock, catalog_properties, token_response, expected_scopes):
3346+
def test_rest_catalog_with_flat_properties_edge_cases(
3347+
requests_mock, rest_mock, catalog_properties, token_response, expected_scopes
3348+
):
33473349
"""Test flat property env-var style for OAuth2, Google, Entra with list[str] scopes and edge cases."""
33483350
if catalog_properties["auth.type"] == "oauth2":
33493351
requests_mock.post(
@@ -3366,8 +3368,10 @@ def test_rest_catalog_with_flat_properties_edge_cases(requests_mock, rest_mock,
33663368
elif catalog_properties["auth.type"] == "google":
33673369
pytest.importorskip("google.auth", reason="google-auth is required for Google auth tests")
33683370
# Patch google.auth.load_credentials_from_file and google.auth.transport.requests.Request
3369-
with mock.patch("google.auth.load_credentials_from_file") as mock_load_creds, \
3370-
mock.patch("google.auth.transport.requests.Request") as mock_google_request:
3371+
with (
3372+
mock.patch("google.auth.load_credentials_from_file") as mock_load_creds,
3373+
mock.patch("google.auth.transport.requests.Request") as mock_google_request,
3374+
):
33713375
mock_credentials = mock.MagicMock()
33723376
mock_credentials.token = "file_token"
33733377
mock_load_creds.return_value = (mock_credentials, "test_project_file")

0 commit comments

Comments
 (0)