Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Bump moto from 4.2.14 to 5.0.5 #40

Merged
merged 3 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pyupgrade = "^3.3.1"
mypy = "^1.0.0"
isort = "^5.11.5"
singer-sdk = { version="^0.23.0", extras = ["testing"] }
moto = "^4.1.6"
moto = "^5.0.5"
coverage = "^7.2.3"
pydocstyle = "^6.3.0"

Expand Down
17 changes: 8 additions & 9 deletions tests/test_boto_connector.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from unittest.mock import patch

from moto import mock_dynamodb, mock_sts
from moto import mock_aws

from tap_dynamodb.connectors.aws_boto_connector import AWSBotoConnector

Expand All @@ -9,7 +9,7 @@
"tap_dynamodb.connectors.aws_boto_connector.boto3.Session",
return_value="mock_session",
)
@mock_dynamodb
@mock_aws
def test_get_session_base(patch):
auth = AWSBotoConnector(
{
Expand All @@ -32,7 +32,7 @@ def test_get_session_base(patch):
"tap_dynamodb.connectors.aws_boto_connector.boto3.Session",
return_value="mock_session",
)
@mock_dynamodb
@mock_aws
def test_get_session_w_token(patch):
auth = AWSBotoConnector(
{
Expand All @@ -57,7 +57,7 @@ def test_get_session_w_token(patch):
"tap_dynamodb.connectors.aws_boto_connector.boto3.Session",
return_value="mock_session",
)
@mock_dynamodb
@mock_aws
def test_get_session_w_profile(patch):
auth = AWSBotoConnector(
{
Expand All @@ -76,16 +76,15 @@ def test_get_session_w_profile(patch):
"tap_dynamodb.connectors.aws_boto_connector.boto3.Session",
return_value="mock_session",
)
@mock_dynamodb
@mock_aws
def test_get_session_implicit(patch):
auth = AWSBotoConnector({}, "dynamodb")
session = auth.get_session()
patch.assert_called_with()
assert session == "mock_session"


@mock_dynamodb
@mock_sts
@mock_aws
def test_get_session_assume_role():
auth = AWSBotoConnector(
{
Expand All @@ -99,7 +98,7 @@ def test_get_session_assume_role():
auth.get_session()


@mock_dynamodb
@mock_aws
def test_get_client():
auth = AWSBotoConnector(
{
Expand All @@ -113,7 +112,7 @@ def test_get_client():
auth.get_client(session, "dynamodb")


@mock_dynamodb
@mock_aws
def test_get_resource():
auth = AWSBotoConnector(
{
Expand Down
20 changes: 10 additions & 10 deletions tests/test_dynamodb_connector.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import boto3
from moto import mock_dynamodb
from moto import mock_aws

from tap_dynamodb.dynamodb_connector import DynamoDbConnector

Expand All @@ -25,7 +25,7 @@ def create_table(moto_conn, name):
)


@mock_dynamodb
@mock_aws
def test_list_tables():
# PREP
moto_conn = boto3.resource("dynamodb", region_name="us-west-2")
Expand All @@ -40,7 +40,7 @@ def test_list_tables():
assert tables[-1] == "table_105"


@mock_dynamodb
@mock_aws
def test_list_tables_filtered():
# PREP
moto_conn = boto3.resource("dynamodb", region_name="us-west-2")
Expand All @@ -59,7 +59,7 @@ def test_list_tables_filtered():
assert len(tables) == 0


@mock_dynamodb
@mock_aws
def test_get_items():
# PREP
moto_conn = boto3.resource("dynamodb", region_name="us-west-2")
Expand All @@ -76,7 +76,7 @@ def test_get_items():
assert records[0].get("info") == {"plot": "bar"}


@mock_dynamodb
@mock_aws
def test_get_items_w_kwargs():
# PREP
moto_conn = boto3.resource("dynamodb", region_name="us-west-2")
Expand All @@ -97,7 +97,7 @@ def test_get_items_w_kwargs():
assert records[0].get("info") == {"plot": "bar"}


@mock_dynamodb
@mock_aws
def test_get_items_paginate():
# PREP
moto_conn = boto3.resource("dynamodb", region_name="us-west-2")
Expand All @@ -122,7 +122,7 @@ def test_get_items_paginate():
assert first_item.get("info") == {"plot": "bar"}


@mock_dynamodb
@mock_aws
def test_get_table_json_schema():
# PREP
moto_conn = boto3.resource("dynamodb", region_name="us-west-2")
Expand All @@ -145,7 +145,7 @@ def test_get_table_json_schema():
}


@mock_dynamodb
@mock_aws
def test_get_table_json_schema_w_kwargs():
# PREP
moto_conn = boto3.resource("dynamodb", region_name="us-west-2")
Expand All @@ -171,7 +171,7 @@ def test_get_table_json_schema_w_kwargs():
}


@mock_dynamodb
@mock_aws
def test_get_table_key_properties():
# PREP
moto_conn = boto3.resource("dynamodb", region_name="us-west-2")
Expand All @@ -194,7 +194,7 @@ def test_coerce_types():
assert coerced == {"foo": "1.23"}


@mock_dynamodb
@mock_aws
def test_get_sample_records():
# PREP
moto_conn = boto3.resource("dynamodb", region_name="us-west-2")
Expand Down