diff --git a/poetry.lock b/poetry.lock index 6f2f055..4e11360 100644 --- a/poetry.lock +++ b/poetry.lock @@ -837,46 +837,46 @@ files = [ [[package]] name = "moto" -version = "4.2.14" +version = "5.0.5" description = "" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "moto-4.2.14-py2.py3-none-any.whl", hash = "sha256:6d242dbbabe925bb385ddb6958449e5c827670b13b8e153ed63f91dbdb50372c"}, - {file = "moto-4.2.14.tar.gz", hash = "sha256:8f9263ca70b646f091edcc93e97cda864a542e6d16ed04066b1370ed217bd190"}, + {file = "moto-5.0.5-py2.py3-none-any.whl", hash = "sha256:4ecdd4084491a2f25f7a7925416dcf07eee0031ce724957439a32ef764b22874"}, + {file = "moto-5.0.5.tar.gz", hash = "sha256:2eaca2df7758f6868df420bf0725cd0b93d98709606f1fb8b2343b5bdc822d91"}, ] [package.dependencies] boto3 = ">=1.9.201" -botocore = ">=1.12.201" +botocore = ">=1.14.0" cryptography = ">=3.3.1" Jinja2 = ">=2.10.1" python-dateutil = ">=2.1,<3.0.0" requests = ">=2.5" -responses = ">=0.13.0" +responses = ">=0.15.0" werkzeug = ">=0.5,<2.2.0 || >2.2.0,<2.2.1 || >2.2.1" xmltodict = "*" [package.extras] -all = ["PyYAML (>=5.1)", "aws-xray-sdk (>=0.93,!=0.96)", "cfn-lint (>=0.40.0)", "docker (>=3.0.0)", "ecdsa (!=0.15)", "graphql-core", "jsondiff (>=1.1.2)", "multipart", "openapi-spec-validator (>=0.5.0)", "py-partiql-parser (==0.5.0)", "pyparsing (>=3.0.7)", "python-jose[cryptography] (>=3.1.0,<4.0.0)", "setuptools", "sshpubkeys (>=3.1.0)"] -apigateway = ["PyYAML (>=5.1)", "ecdsa (!=0.15)", "openapi-spec-validator (>=0.5.0)", "python-jose[cryptography] (>=3.1.0,<4.0.0)"] -apigatewayv2 = ["PyYAML (>=5.1)"] +all = ["PyYAML (>=5.1)", "antlr4-python3-runtime", "aws-xray-sdk (>=0.93,!=0.96)", "cfn-lint (>=0.40.0)", "docker (>=3.0.0)", "graphql-core", "joserfc (>=0.9.0)", "jsondiff (>=1.1.2)", "jsonpath-ng", "multipart", "openapi-spec-validator (>=0.5.0)", "py-partiql-parser (==0.5.4)", "pyparsing (>=3.0.7)", "setuptools"] +apigateway = ["PyYAML (>=5.1)", "joserfc (>=0.9.0)", "openapi-spec-validator (>=0.5.0)"] +apigatewayv2 = ["PyYAML (>=5.1)", "openapi-spec-validator (>=0.5.0)"] appsync = ["graphql-core"] awslambda = ["docker (>=3.0.0)"] batch = ["docker (>=3.0.0)"] -cloudformation = ["PyYAML (>=5.1)", "aws-xray-sdk (>=0.93,!=0.96)", "cfn-lint (>=0.40.0)", "docker (>=3.0.0)", "ecdsa (!=0.15)", "graphql-core", "jsondiff (>=1.1.2)", "openapi-spec-validator (>=0.5.0)", "py-partiql-parser (==0.5.0)", "pyparsing (>=3.0.7)", "python-jose[cryptography] (>=3.1.0,<4.0.0)", "setuptools", "sshpubkeys (>=3.1.0)"] -cognitoidp = ["ecdsa (!=0.15)", "python-jose[cryptography] (>=3.1.0,<4.0.0)"] -dynamodb = ["docker (>=3.0.0)", "py-partiql-parser (==0.5.0)"] -dynamodbstreams = ["docker (>=3.0.0)", "py-partiql-parser (==0.5.0)"] -ec2 = ["sshpubkeys (>=3.1.0)"] +cloudformation = ["PyYAML (>=5.1)", "aws-xray-sdk (>=0.93,!=0.96)", "cfn-lint (>=0.40.0)", "docker (>=3.0.0)", "graphql-core", "joserfc (>=0.9.0)", "jsondiff (>=1.1.2)", "openapi-spec-validator (>=0.5.0)", "py-partiql-parser (==0.5.4)", "pyparsing (>=3.0.7)", "setuptools"] +cognitoidp = ["joserfc (>=0.9.0)"] +dynamodb = ["docker (>=3.0.0)", "py-partiql-parser (==0.5.4)"] +dynamodbstreams = ["docker (>=3.0.0)", "py-partiql-parser (==0.5.4)"] glue = ["pyparsing (>=3.0.7)"] iotdata = ["jsondiff (>=1.1.2)"] -proxy = ["PyYAML (>=5.1)", "aws-xray-sdk (>=0.93,!=0.96)", "cfn-lint (>=0.40.0)", "docker (>=2.5.1)", "ecdsa (!=0.15)", "graphql-core", "jsondiff (>=1.1.2)", "multipart", "openapi-spec-validator (>=0.5.0)", "py-partiql-parser (==0.5.0)", "pyparsing (>=3.0.7)", "python-jose[cryptography] (>=3.1.0,<4.0.0)", "setuptools", "sshpubkeys (>=3.1.0)"] -resourcegroupstaggingapi = ["PyYAML (>=5.1)", "cfn-lint (>=0.40.0)", "docker (>=3.0.0)", "ecdsa (!=0.15)", "graphql-core", "jsondiff (>=1.1.2)", "openapi-spec-validator (>=0.5.0)", "py-partiql-parser (==0.5.0)", "pyparsing (>=3.0.7)", "python-jose[cryptography] (>=3.1.0,<4.0.0)"] -s3 = ["PyYAML (>=5.1)", "py-partiql-parser (==0.5.0)"] -s3crc32c = ["PyYAML (>=5.1)", "crc32c", "py-partiql-parser (==0.5.0)"] -server = ["PyYAML (>=5.1)", "aws-xray-sdk (>=0.93,!=0.96)", "cfn-lint (>=0.40.0)", "docker (>=3.0.0)", "ecdsa (!=0.15)", "flask (!=2.2.0,!=2.2.1)", "flask-cors", "graphql-core", "jsondiff (>=1.1.2)", "openapi-spec-validator (>=0.5.0)", "py-partiql-parser (==0.5.0)", "pyparsing (>=3.0.7)", "python-jose[cryptography] (>=3.1.0,<4.0.0)", "setuptools", "sshpubkeys (>=3.1.0)"] +proxy = ["PyYAML (>=5.1)", "antlr4-python3-runtime", "aws-xray-sdk (>=0.93,!=0.96)", "cfn-lint (>=0.40.0)", "docker (>=2.5.1)", "graphql-core", "joserfc (>=0.9.0)", "jsondiff (>=1.1.2)", "jsonpath-ng", "multipart", "openapi-spec-validator (>=0.5.0)", "py-partiql-parser (==0.5.4)", "pyparsing (>=3.0.7)", "setuptools"] +resourcegroupstaggingapi = ["PyYAML (>=5.1)", "cfn-lint (>=0.40.0)", "docker (>=3.0.0)", "graphql-core", "joserfc (>=0.9.0)", "jsondiff (>=1.1.2)", "openapi-spec-validator (>=0.5.0)", "py-partiql-parser (==0.5.4)", "pyparsing (>=3.0.7)"] +s3 = ["PyYAML (>=5.1)", "py-partiql-parser (==0.5.4)"] +s3crc32c = ["PyYAML (>=5.1)", "crc32c", "py-partiql-parser (==0.5.4)"] +server = ["PyYAML (>=5.1)", "antlr4-python3-runtime", "aws-xray-sdk (>=0.93,!=0.96)", "cfn-lint (>=0.40.0)", "docker (>=3.0.0)", "flask (!=2.2.0,!=2.2.1)", "flask-cors", "graphql-core", "joserfc (>=0.9.0)", "jsondiff (>=1.1.2)", "jsonpath-ng", "openapi-spec-validator (>=0.5.0)", "py-partiql-parser (==0.5.4)", "pyparsing (>=3.0.7)", "setuptools"] ssm = ["PyYAML (>=5.1)"] +stepfunctions = ["antlr4-python3-runtime", "jsonpath-ng"] xray = ["aws-xray-sdk (>=0.93,!=0.96)", "setuptools"] [[package]] @@ -1890,4 +1890,4 @@ s3 = ["fs-s3fs"] [metadata] lock-version = "2.0" python-versions = "<3.12,>=3.8" -content-hash = "b44f087d7f50cfb57d56a4ff5fc9589824521fe2465ff926ffb66103f9069e33" +content-hash = "44d8085087c9fe45acd98eebf5980ac5259adb30c2495de9afe49e67e9aac136" diff --git a/pyproject.toml b/pyproject.toml index dee88b3..bcf262f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/tests/test_boto_connector.py b/tests/test_boto_connector.py index 9a8f355..a2b5625 100644 --- a/tests/test_boto_connector.py +++ b/tests/test_boto_connector.py @@ -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 @@ -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( { @@ -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( { @@ -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( { @@ -76,7 +76,7 @@ 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() @@ -84,8 +84,7 @@ def test_get_session_implicit(patch): assert session == "mock_session" -@mock_dynamodb -@mock_sts +@mock_aws def test_get_session_assume_role(): auth = AWSBotoConnector( { @@ -99,7 +98,7 @@ def test_get_session_assume_role(): auth.get_session() -@mock_dynamodb +@mock_aws def test_get_client(): auth = AWSBotoConnector( { @@ -113,7 +112,7 @@ def test_get_client(): auth.get_client(session, "dynamodb") -@mock_dynamodb +@mock_aws def test_get_resource(): auth = AWSBotoConnector( { diff --git a/tests/test_dynamodb_connector.py b/tests/test_dynamodb_connector.py index 286c41f..35ce39b 100644 --- a/tests/test_dynamodb_connector.py +++ b/tests/test_dynamodb_connector.py @@ -1,5 +1,5 @@ import boto3 -from moto import mock_dynamodb +from moto import mock_aws from tap_dynamodb.dynamodb_connector import DynamoDbConnector @@ -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") @@ -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") @@ -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") @@ -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") @@ -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") @@ -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") @@ -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") @@ -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") @@ -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")