Skip to content

Commit 99fefb1

Browse files
committed
fix tests based on deprecated properties
1 parent eae0dfa commit 99fefb1

File tree

2 files changed

+1
-47
lines changed

2 files changed

+1
-47
lines changed

tests/catalog/test_dynamodb.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -562,28 +562,6 @@ def test_update_namespace_properties_overlap_update_removal(_bucket_initialize:
562562
assert test_catalog.load_namespace_properties(database_name) == test_properties
563563

564564

565-
def test_passing_provided_profile() -> None:
566-
catalog_name = "test_ddb_catalog"
567-
session_props = {
568-
"aws_access_key_id": "abc",
569-
"aws_secret_access_key": "def",
570-
"aws_session_token": "ghi",
571-
"region_name": "eu-central-1",
572-
"botocore_session": None,
573-
"profile_name": None,
574-
}
575-
props = {"py-io-impl": "pyiceberg.io.fsspec.FsspecFileIO"}
576-
props.update(session_props) # type: ignore
577-
with mock.patch("boto3.Session", return_value=mock.Mock()) as mock_session:
578-
mock_client = mock.Mock()
579-
mock_session.return_value.client.return_value = mock_client
580-
mock_client.describe_table.return_value = {"Table": {"TableStatus": "ACTIVE"}}
581-
test_catalog = DynamoDbCatalog(catalog_name, **props)
582-
assert test_catalog.dynamodb is mock_client
583-
mock_session.assert_called_with(**session_props)
584-
assert test_catalog.dynamodb is mock_session().client()
585-
586-
587565
@mock_aws
588566
def test_passing_glue_session_properties() -> None:
589567
session_properties: Properties = {
@@ -607,7 +585,6 @@ def test_passing_glue_session_properties() -> None:
607585
aws_session_token="dynamodb.session-token",
608586
region_name="dynamodb.region",
609587
profile_name="dynamodb.profile-name",
610-
botocore_session=None,
611588
)
612589
assert test_catalog.dynamodb is mock_session().client()
613590

@@ -631,7 +608,6 @@ def test_passing_unified_session_properties_to_dynamodb() -> None:
631608
aws_session_token="client.session-token",
632609
region_name="client.region",
633610
profile_name="dynamodb.profile-name",
634-
botocore_session=None,
635611
)
636612
assert test_catalog.dynamodb is mock_session().client()
637613

tests/catalog/test_glue.py

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
from typing import Any, Dict, List
17+
from typing import List
1818
from unittest import mock
1919

2020
import boto3
@@ -637,26 +637,6 @@ def test_update_namespace_properties_overlap_update_removal(
637637
assert test_catalog.load_namespace_properties(database_name) == test_properties
638638

639639

640-
@mock_aws
641-
def test_passing_profile_name() -> None:
642-
session_properties: Dict[str, Any] = {
643-
"aws_access_key_id": "abc",
644-
"aws_secret_access_key": "def",
645-
"aws_session_token": "ghi",
646-
"region_name": "eu-central-1",
647-
"profile_name": "sandbox",
648-
"botocore_session": None,
649-
}
650-
test_properties = {"type": "glue"}
651-
test_properties.update(session_properties)
652-
653-
with mock.patch("boto3.Session") as mock_session:
654-
test_catalog = GlueCatalog("glue", **test_properties)
655-
656-
mock_session.assert_called_with(**session_properties)
657-
assert test_catalog.glue is mock_session().client()
658-
659-
660640
@mock_aws
661641
def test_passing_glue_session_properties() -> None:
662642
session_properties: Properties = {
@@ -677,7 +657,6 @@ def test_passing_glue_session_properties() -> None:
677657
aws_session_token="glue.session-token",
678658
region_name="glue.region",
679659
profile_name="glue.profile-name",
680-
botocore_session=None,
681660
)
682661
assert test_catalog.glue is mock_session().client()
683662

@@ -698,7 +677,6 @@ def test_passing_unified_session_properties_to_glue() -> None:
698677
aws_session_token="client.session-token",
699678
region_name="client.region",
700679
profile_name="glue.profile-name",
701-
botocore_session=None,
702680
)
703681
assert test_catalog.glue is mock_session().client()
704682

0 commit comments

Comments
 (0)