File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515# specific language governing permissions and limitations
1616# under the License.
1717# pylint: disable=redefined-outer-name,unused-argument
18+ import base64
1819import os
1920from typing import Any , Callable , Dict , cast
2021from unittest import mock
@@ -1540,6 +1541,10 @@ def test_rest_catalog_with_basic_auth_type(rest_mock: Mocker) -> None:
15401541 catalog = RestCatalog ("rest" , ** catalog_properties ) # type: ignore
15411542 assert catalog .uri == TEST_URI
15421543
1544+ encoded_user_pass = base64 .b64encode (b"one:two" ).decode ()
1545+ expected_auth_header = f"Basic { encoded_user_pass } "
1546+ assert rest_mock .last_request .headers ["Authorization" ] == expected_auth_header
1547+
15431548
15441549def test_rest_catalog_with_custom_auth_type () -> None :
15451550 # Given
@@ -1581,6 +1586,10 @@ def test_rest_catalog_with_custom_basic_auth_type(rest_mock: Mocker) -> None:
15811586 catalog = RestCatalog ("rest" , ** catalog_properties ) # type: ignore
15821587 assert catalog .uri == TEST_URI
15831588
1589+ encoded_user_pass = base64 .b64encode (b"one:two" ).decode ()
1590+ expected_auth_header = f"Basic { encoded_user_pass } "
1591+ assert rest_mock .last_request .headers ["Authorization" ] == expected_auth_header
1592+
15841593
15851594def test_rest_catalog_with_custom_auth_type_no_impl () -> None :
15861595 # Given
You can’t perform that action at this time.
0 commit comments