Remove more DynamoDB2 references (#4933)
This commit is contained in:
parent
eed32a5f72
commit
382ff2b1a9
3
setup.py
3
setup.py
@ -102,7 +102,8 @@ extras_per_service.update(
|
|||||||
)
|
)
|
||||||
|
|
||||||
# When a Table has a Stream, we'll always need to import AWSLambda to search for a corresponding function to send the table data to
|
# When a Table has a Stream, we'll always need to import AWSLambda to search for a corresponding function to send the table data to
|
||||||
extras_per_service["dynamodb2"] = extras_per_service["awslambda"]
|
extras_per_service["dynamodb"] = extras_per_service["awslambda"]
|
||||||
|
extras_per_service["dynamodb2"] = extras_per_service["dynamodb"]
|
||||||
extras_per_service["dynamodbstreams"] = extras_per_service["awslambda"]
|
extras_per_service["dynamodbstreams"] = extras_per_service["awslambda"]
|
||||||
# EFS depends on EC2 to find subnets etc
|
# EFS depends on EC2 to find subnets etc
|
||||||
extras_per_service["efs"] = extras_per_service["ec2"]
|
extras_per_service["efs"] = extras_per_service["ec2"]
|
||||||
|
@ -2,7 +2,7 @@ import boto3
|
|||||||
import json
|
import json
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from moto import mock_apigateway, mock_dynamodb2
|
from moto import mock_apigateway, mock_dynamodb
|
||||||
from moto import settings
|
from moto import settings
|
||||||
from moto.core.models import responses_mock
|
from moto.core.models import responses_mock
|
||||||
from unittest import SkipTest
|
from unittest import SkipTest
|
||||||
@ -54,7 +54,7 @@ def test_http_integration():
|
|||||||
|
|
||||||
|
|
||||||
@mock_apigateway
|
@mock_apigateway
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
def test_aws_integration_dynamodb():
|
def test_aws_integration_dynamodb():
|
||||||
if settings.TEST_SERVER_MODE:
|
if settings.TEST_SERVER_MODE:
|
||||||
raise SkipTest("Cannot test mock of execute-api.apigateway in ServerMode")
|
raise SkipTest("Cannot test mock of execute-api.apigateway in ServerMode")
|
||||||
@ -79,7 +79,7 @@ def test_aws_integration_dynamodb():
|
|||||||
|
|
||||||
|
|
||||||
@mock_apigateway
|
@mock_apigateway
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
def test_aws_integration_dynamodb_multiple_stages():
|
def test_aws_integration_dynamodb_multiple_stages():
|
||||||
if settings.TEST_SERVER_MODE:
|
if settings.TEST_SERVER_MODE:
|
||||||
raise SkipTest("Cannot test mock of execute-api.apigateway in ServerMode")
|
raise SkipTest("Cannot test mock of execute-api.apigateway in ServerMode")
|
||||||
@ -116,7 +116,7 @@ def test_aws_integration_dynamodb_multiple_stages():
|
|||||||
|
|
||||||
|
|
||||||
@mock_apigateway
|
@mock_apigateway
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
def test_aws_integration_dynamodb_multiple_resources():
|
def test_aws_integration_dynamodb_multiple_resources():
|
||||||
if settings.TEST_SERVER_MODE:
|
if settings.TEST_SERVER_MODE:
|
||||||
raise SkipTest("Cannot test mock of execute-api.apigateway in ServerMode")
|
raise SkipTest("Cannot test mock of execute-api.apigateway in ServerMode")
|
||||||
|
@ -6,7 +6,7 @@ import time
|
|||||||
import sure # noqa # pylint: disable=unused-import
|
import sure # noqa # pylint: disable=unused-import
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from moto import mock_dynamodb2, mock_lambda, mock_logs, mock_sns, mock_sqs
|
from moto import mock_dynamodb, mock_lambda, mock_logs, mock_sns, mock_sqs
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
from .utilities import (
|
from .utilities import (
|
||||||
get_role_name,
|
get_role_name,
|
||||||
@ -97,7 +97,7 @@ def test_invoke_function_from_sqs(key):
|
|||||||
@pytest.mark.network
|
@pytest.mark.network
|
||||||
@mock_logs
|
@mock_logs
|
||||||
@mock_lambda
|
@mock_lambda
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
def test_invoke_function_from_dynamodb_put():
|
def test_invoke_function_from_dynamodb_put():
|
||||||
dynamodb = boto3.client("dynamodb", region_name="us-east-1")
|
dynamodb = boto3.client("dynamodb", region_name="us-east-1")
|
||||||
table_name = str(uuid4())[0:6] + "_table"
|
table_name = str(uuid4())[0:6] + "_table"
|
||||||
@ -148,7 +148,7 @@ def test_invoke_function_from_dynamodb_put():
|
|||||||
@pytest.mark.network
|
@pytest.mark.network
|
||||||
@mock_logs
|
@mock_logs
|
||||||
@mock_lambda
|
@mock_lambda
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
def test_invoke_function_from_dynamodb_update():
|
def test_invoke_function_from_dynamodb_update():
|
||||||
dynamodb = boto3.client("dynamodb", region_name="us-east-1")
|
dynamodb = boto3.client("dynamodb", region_name="us-east-1")
|
||||||
table_name = str(uuid4())[0:6] + "_table"
|
table_name = str(uuid4())[0:6] + "_table"
|
||||||
|
@ -14,7 +14,7 @@ from unittest import SkipTest
|
|||||||
|
|
||||||
from moto import (
|
from moto import (
|
||||||
mock_cloudformation,
|
mock_cloudformation,
|
||||||
mock_dynamodb2,
|
mock_dynamodb,
|
||||||
mock_s3,
|
mock_s3,
|
||||||
mock_sns,
|
mock_sns,
|
||||||
mock_sqs,
|
mock_sqs,
|
||||||
@ -2113,7 +2113,7 @@ def test_boto3_create_duplicate_stack():
|
|||||||
cf_conn.create_stack(StackName="test_stack", TemplateBody=dummy_template_json)
|
cf_conn.create_stack(StackName="test_stack", TemplateBody=dummy_template_json)
|
||||||
|
|
||||||
|
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
@mock_cloudformation
|
@mock_cloudformation
|
||||||
def test_delete_stack_dynamo_template():
|
def test_delete_stack_dynamo_template():
|
||||||
conn = boto3.client("cloudformation", region_name="us-east-1")
|
conn = boto3.client("cloudformation", region_name="us-east-1")
|
||||||
@ -2127,7 +2127,7 @@ def test_delete_stack_dynamo_template():
|
|||||||
conn.create_stack(StackName="test_stack", TemplateBody=dummy_template_json4)
|
conn.create_stack(StackName="test_stack", TemplateBody=dummy_template_json4)
|
||||||
|
|
||||||
|
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
@mock_cloudformation
|
@mock_cloudformation
|
||||||
@mock_lambda
|
@mock_lambda
|
||||||
def test_create_stack_lambda_and_dynamodb():
|
def test_create_stack_lambda_and_dynamodb():
|
||||||
|
@ -13,7 +13,7 @@ from string import Template
|
|||||||
from moto import (
|
from moto import (
|
||||||
mock_autoscaling,
|
mock_autoscaling,
|
||||||
mock_cloudformation,
|
mock_cloudformation,
|
||||||
mock_dynamodb2,
|
mock_dynamodb,
|
||||||
mock_ec2,
|
mock_ec2,
|
||||||
mock_events,
|
mock_events,
|
||||||
mock_kms,
|
mock_kms,
|
||||||
@ -986,7 +986,7 @@ def test_stack_elbv2_resources_integration():
|
|||||||
name["OutputValue"].should.equal(load_balancers[0]["LoadBalancerName"])
|
name["OutputValue"].should.equal(load_balancers[0]["LoadBalancerName"])
|
||||||
|
|
||||||
|
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
@mock_cloudformation
|
@mock_cloudformation
|
||||||
def test_stack_dynamodb_resources_integration():
|
def test_stack_dynamodb_resources_integration():
|
||||||
dynamodb_template = {
|
dynamodb_template = {
|
||||||
@ -1628,7 +1628,7 @@ def test_stack_events_get_attribute_integration():
|
|||||||
|
|
||||||
|
|
||||||
@mock_cloudformation
|
@mock_cloudformation
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
def test_dynamodb_table_creation():
|
def test_dynamodb_table_creation():
|
||||||
CFN_TEMPLATE = {
|
CFN_TEMPLATE = {
|
||||||
"Outputs": {"MyTableName": {"Value": {"Ref": "MyTable"}}},
|
"Outputs": {"MyTableName": {"Value": {"Ref": "MyTable"}}},
|
||||||
|
@ -2,7 +2,7 @@ import boto3
|
|||||||
import mock
|
import mock
|
||||||
import os
|
import os
|
||||||
import pytest
|
import pytest
|
||||||
from moto import mock_dynamodb2, mock_sns, settings
|
from moto import mock_dynamodb, mock_sns, settings
|
||||||
from unittest import SkipTest
|
from unittest import SkipTest
|
||||||
|
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ def test_use_unknown_region_from_env_but_allow_it():
|
|||||||
client.list_platform_applications()["PlatformApplications"].should.equal([])
|
client.list_platform_applications()["PlatformApplications"].should.equal([])
|
||||||
|
|
||||||
|
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
@mock.patch.dict(os.environ, {"MOTO_ALLOW_NONEXISTENT_REGION": "trUe"})
|
@mock.patch.dict(os.environ, {"MOTO_ALLOW_NONEXISTENT_REGION": "trUe"})
|
||||||
def test_use_unknown_region_from_env_but_allow_it__dynamo():
|
def test_use_unknown_region_from_env_but_allow_it__dynamo():
|
||||||
if settings.TEST_SERVER_MODE:
|
if settings.TEST_SERVER_MODE:
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import unittest
|
import unittest
|
||||||
from moto import mock_dynamodb2
|
from moto import mock_dynamodb
|
||||||
import socket
|
import socket
|
||||||
|
|
||||||
|
|
||||||
class TestSocketPair(unittest.TestCase):
|
class TestSocketPair(unittest.TestCase):
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
def test_socket_pair(self):
|
def test_socket_pair(self):
|
||||||
a, b = socket.socketpair()
|
a, b = socket.socketpair()
|
||||||
self.assertIsNotNone(a)
|
self.assertIsNotNone(a)
|
||||||
|
@ -3,7 +3,7 @@ import pytest
|
|||||||
import sure # noqa # pylint: disable=unused-import
|
import sure # noqa # pylint: disable=unused-import
|
||||||
from boto3.dynamodb.conditions import Key
|
from boto3.dynamodb.conditions import Key
|
||||||
from botocore.exceptions import ClientError
|
from botocore.exceptions import ClientError
|
||||||
from moto import mock_dynamodb2
|
from moto import mock_dynamodb
|
||||||
|
|
||||||
table_schema = {
|
table_schema = {
|
||||||
"KeySchema": [{"AttributeName": "partitionKey", "KeyType": "HASH"}],
|
"KeySchema": [{"AttributeName": "partitionKey", "KeyType": "HASH"}],
|
||||||
@ -25,7 +25,7 @@ table_schema = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
def test_query_gsi_with_wrong_key_attribute_names_throws_exception():
|
def test_query_gsi_with_wrong_key_attribute_names_throws_exception():
|
||||||
item = {
|
item = {
|
||||||
"partitionKey": "pk-1",
|
"partitionKey": "pk-1",
|
||||||
@ -98,7 +98,7 @@ def test_query_gsi_with_wrong_key_attribute_names_throws_exception():
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
def test_empty_expressionattributenames():
|
def test_empty_expressionattributenames():
|
||||||
ddb = boto3.resource("dynamodb", region_name="us-east-1")
|
ddb = boto3.resource("dynamodb", region_name="us-east-1")
|
||||||
ddb.create_table(
|
ddb.create_table(
|
||||||
@ -114,7 +114,7 @@ def test_empty_expressionattributenames():
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
def test_empty_expressionattributenames_with_empty_projection():
|
def test_empty_expressionattributenames_with_empty_projection():
|
||||||
ddb = boto3.resource("dynamodb", region_name="us-east-1")
|
ddb = boto3.resource("dynamodb", region_name="us-east-1")
|
||||||
ddb.create_table(
|
ddb.create_table(
|
||||||
@ -130,7 +130,7 @@ def test_empty_expressionattributenames_with_empty_projection():
|
|||||||
err["Message"].should.equal("ExpressionAttributeNames must not be empty")
|
err["Message"].should.equal("ExpressionAttributeNames must not be empty")
|
||||||
|
|
||||||
|
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
def test_empty_expressionattributenames_with_projection():
|
def test_empty_expressionattributenames_with_projection():
|
||||||
ddb = boto3.resource("dynamodb", region_name="us-east-1")
|
ddb = boto3.resource("dynamodb", region_name="us-east-1")
|
||||||
ddb.create_table(
|
ddb.create_table(
|
||||||
@ -146,7 +146,7 @@ def test_empty_expressionattributenames_with_projection():
|
|||||||
err["Message"].should.equal("ExpressionAttributeNames must not be empty")
|
err["Message"].should.equal("ExpressionAttributeNames must not be empty")
|
||||||
|
|
||||||
|
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
def test_update_item_range_key_set():
|
def test_update_item_range_key_set():
|
||||||
ddb = boto3.resource("dynamodb", region_name="us-east-1")
|
ddb = boto3.resource("dynamodb", region_name="us-east-1")
|
||||||
|
|
||||||
@ -168,7 +168,7 @@ def test_update_item_range_key_set():
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
def test_batch_get_item_non_existing_table():
|
def test_batch_get_item_non_existing_table():
|
||||||
|
|
||||||
client = boto3.client("dynamodb", region_name="us-west-2")
|
client = boto3.client("dynamodb", region_name="us-west-2")
|
||||||
@ -180,7 +180,7 @@ def test_batch_get_item_non_existing_table():
|
|||||||
assert err["Message"].should.equal("Requested resource not found")
|
assert err["Message"].should.equal("Requested resource not found")
|
||||||
|
|
||||||
|
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
def test_batch_write_item_non_existing_table():
|
def test_batch_write_item_non_existing_table():
|
||||||
client = boto3.client("dynamodb", region_name="us-west-2")
|
client = boto3.client("dynamodb", region_name="us-west-2")
|
||||||
|
|
||||||
@ -194,7 +194,7 @@ def test_batch_write_item_non_existing_table():
|
|||||||
assert err["Message"].should.equal("Requested resource not found")
|
assert err["Message"].should.equal("Requested resource not found")
|
||||||
|
|
||||||
|
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
def test_create_table_with_redundant_attributes():
|
def test_create_table_with_redundant_attributes():
|
||||||
dynamodb = boto3.client("dynamodb", region_name="us-east-1")
|
dynamodb = boto3.client("dynamodb", region_name="us-east-1")
|
||||||
|
|
||||||
@ -241,7 +241,7 @@ def test_create_table_with_redundant_attributes():
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
def test_create_table_with_missing_attributes():
|
def test_create_table_with_missing_attributes():
|
||||||
dynamodb = boto3.client("dynamodb", region_name="us-east-1")
|
dynamodb = boto3.client("dynamodb", region_name="us-east-1")
|
||||||
|
|
||||||
@ -284,7 +284,7 @@ def test_create_table_with_missing_attributes():
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
def test_create_table_with_redundant_and_missing_attributes():
|
def test_create_table_with_redundant_and_missing_attributes():
|
||||||
dynamodb = boto3.client("dynamodb", region_name="us-east-1")
|
dynamodb = boto3.client("dynamodb", region_name="us-east-1")
|
||||||
|
|
||||||
@ -327,7 +327,7 @@ def test_create_table_with_redundant_and_missing_attributes():
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
def test_put_item_wrong_attribute_type():
|
def test_put_item_wrong_attribute_type():
|
||||||
dynamodb = boto3.client("dynamodb", region_name="us-east-1")
|
dynamodb = boto3.client("dynamodb", region_name="us-east-1")
|
||||||
|
|
||||||
@ -373,7 +373,7 @@ def test_put_item_wrong_attribute_type():
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
# https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html#DDB-Query-request-KeyConditionExpression
|
# https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html#DDB-Query-request-KeyConditionExpression
|
||||||
def test_hash_key_cannot_use_begins_with_operations():
|
def test_hash_key_cannot_use_begins_with_operations():
|
||||||
dynamodb = boto3.resource("dynamodb", region_name="us-east-1")
|
dynamodb = boto3.resource("dynamodb", region_name="us-east-1")
|
||||||
@ -404,7 +404,7 @@ def test_hash_key_cannot_use_begins_with_operations():
|
|||||||
|
|
||||||
|
|
||||||
# Test this again, but with manually supplying an operator
|
# Test this again, but with manually supplying an operator
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
@pytest.mark.parametrize("operator", ["<", "<=", ">", ">="])
|
@pytest.mark.parametrize("operator", ["<", "<=", ">", ">="])
|
||||||
def test_hash_key_can_only_use_equals_operations(operator):
|
def test_hash_key_can_only_use_equals_operations(operator):
|
||||||
dynamodb = boto3.resource("dynamodb", region_name="us-east-1")
|
dynamodb = boto3.resource("dynamodb", region_name="us-east-1")
|
||||||
@ -426,7 +426,7 @@ def test_hash_key_can_only_use_equals_operations(operator):
|
|||||||
err["Message"].should.equal("Query key condition not supported")
|
err["Message"].should.equal("Query key condition not supported")
|
||||||
|
|
||||||
|
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
def test_creating_table_with_0_local_indexes():
|
def test_creating_table_with_0_local_indexes():
|
||||||
dynamodb = boto3.resource("dynamodb", region_name="us-east-1")
|
dynamodb = boto3.resource("dynamodb", region_name="us-east-1")
|
||||||
|
|
||||||
@ -445,7 +445,7 @@ def test_creating_table_with_0_local_indexes():
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
def test_creating_table_with_0_global_indexes():
|
def test_creating_table_with_0_global_indexes():
|
||||||
dynamodb = boto3.resource("dynamodb", region_name="us-east-1")
|
dynamodb = boto3.resource("dynamodb", region_name="us-east-1")
|
||||||
|
|
||||||
@ -464,7 +464,7 @@ def test_creating_table_with_0_global_indexes():
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
def test_multiple_transactions_on_same_item():
|
def test_multiple_transactions_on_same_item():
|
||||||
table_schema = {
|
table_schema = {
|
||||||
"KeySchema": [{"AttributeName": "id", "KeyType": "HASH"}],
|
"KeySchema": [{"AttributeName": "id", "KeyType": "HASH"}],
|
||||||
@ -502,7 +502,7 @@ def test_multiple_transactions_on_same_item():
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
def test_transact_write_items__too_many_transactions():
|
def test_transact_write_items__too_many_transactions():
|
||||||
table_schema = {
|
table_schema = {
|
||||||
"KeySchema": [{"AttributeName": "pk", "KeyType": "HASH"}],
|
"KeySchema": [{"AttributeName": "pk", "KeyType": "HASH"}],
|
||||||
@ -534,7 +534,7 @@ def test_transact_write_items__too_many_transactions():
|
|||||||
err["Message"].should.match("Member must have length less than or equal to 25")
|
err["Message"].should.match("Member must have length less than or equal to 25")
|
||||||
|
|
||||||
|
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
def test_update_item_non_existent_table():
|
def test_update_item_non_existent_table():
|
||||||
client = boto3.client("dynamodb", region_name="us-west-2")
|
client = boto3.client("dynamodb", region_name="us-west-2")
|
||||||
with pytest.raises(client.exceptions.ResourceNotFoundException) as exc:
|
with pytest.raises(client.exceptions.ResourceNotFoundException) as exc:
|
||||||
|
@ -4,12 +4,12 @@ import boto3
|
|||||||
import sure # noqa # pylint: disable=unused-import
|
import sure # noqa # pylint: disable=unused-import
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from moto import mock_dynamodb2
|
from moto import mock_dynamodb
|
||||||
from botocore.exceptions import ClientError
|
from botocore.exceptions import ClientError
|
||||||
from moto.dynamodb.limits import HASH_KEY_MAX_LENGTH, RANGE_KEY_MAX_LENGTH
|
from moto.dynamodb.limits import HASH_KEY_MAX_LENGTH, RANGE_KEY_MAX_LENGTH
|
||||||
|
|
||||||
|
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
def test_item_add_long_string_hash_key_exception():
|
def test_item_add_long_string_hash_key_exception():
|
||||||
name = "TestTable"
|
name = "TestTable"
|
||||||
conn = boto3.client("dynamodb", region_name="us-west-2")
|
conn = boto3.client("dynamodb", region_name="us-west-2")
|
||||||
@ -50,7 +50,7 @@ def test_item_add_long_string_hash_key_exception():
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
def test_item_add_long_string_nonascii_hash_key_exception():
|
def test_item_add_long_string_nonascii_hash_key_exception():
|
||||||
name = "TestTable"
|
name = "TestTable"
|
||||||
conn = boto3.client("dynamodb", region_name="us-west-2")
|
conn = boto3.client("dynamodb", region_name="us-west-2")
|
||||||
@ -97,7 +97,7 @@ def test_item_add_long_string_nonascii_hash_key_exception():
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
def test_item_add_long_string_range_key_exception():
|
def test_item_add_long_string_range_key_exception():
|
||||||
name = "TestTable"
|
name = "TestTable"
|
||||||
conn = boto3.client("dynamodb", region_name="us-west-2")
|
conn = boto3.client("dynamodb", region_name="us-west-2")
|
||||||
@ -144,7 +144,7 @@ def test_item_add_long_string_range_key_exception():
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
def test_put_long_string_gsi_range_key_exception():
|
def test_put_long_string_gsi_range_key_exception():
|
||||||
name = "TestTable"
|
name = "TestTable"
|
||||||
conn = boto3.client("dynamodb", region_name="us-west-2")
|
conn = boto3.client("dynamodb", region_name="us-west-2")
|
||||||
@ -213,7 +213,7 @@ def test_put_long_string_gsi_range_key_exception():
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
def test_update_item_with_long_string_hash_key_exception():
|
def test_update_item_with_long_string_hash_key_exception():
|
||||||
name = "TestTable"
|
name = "TestTable"
|
||||||
conn = boto3.client("dynamodb", region_name="us-west-2")
|
conn = boto3.client("dynamodb", region_name="us-west-2")
|
||||||
@ -253,7 +253,7 @@ def test_update_item_with_long_string_hash_key_exception():
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
def test_update_item_with_long_string_range_key_exception():
|
def test_update_item_with_long_string_range_key_exception():
|
||||||
name = "TestTable"
|
name = "TestTable"
|
||||||
conn = boto3.client("dynamodb", region_name="us-west-2")
|
conn = boto3.client("dynamodb", region_name="us-west-2")
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from moto import mock_xray_client, XRaySegment, mock_dynamodb2
|
from moto import mock_xray_client, XRaySegment, mock_dynamodb
|
||||||
import sure # noqa # pylint: disable=unused-import
|
import sure # noqa # pylint: disable=unused-import
|
||||||
import boto3
|
import boto3
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ original_session_prep_request = requests.Session.prepare_request
|
|||||||
|
|
||||||
|
|
||||||
@mock_xray_client
|
@mock_xray_client
|
||||||
@mock_dynamodb2
|
@mock_dynamodb
|
||||||
def test_xray_dynamo_request_id():
|
def test_xray_dynamo_request_id():
|
||||||
# Could be ran in any order, so we need to tell sdk that its been unpatched
|
# Could be ran in any order, so we need to tell sdk that its been unpatched
|
||||||
xray_core_patcher._PATCHED_MODULES = set()
|
xray_core_patcher._PATCHED_MODULES = set()
|
||||||
@ -48,7 +48,7 @@ def test_xray_dynamo_request_id():
|
|||||||
def test_xray_dynamo_request_id_with_context_mgr():
|
def test_xray_dynamo_request_id_with_context_mgr():
|
||||||
with mock_xray_client():
|
with mock_xray_client():
|
||||||
assert isinstance(xray_core.xray_recorder._emitter, MockEmitter)
|
assert isinstance(xray_core.xray_recorder._emitter, MockEmitter)
|
||||||
with mock_dynamodb2():
|
with mock_dynamodb():
|
||||||
# Could be ran in any order, so we need to tell sdk that its been unpatched
|
# Could be ran in any order, so we need to tell sdk that its been unpatched
|
||||||
xray_core_patcher._PATCHED_MODULES = set()
|
xray_core_patcher._PATCHED_MODULES = set()
|
||||||
xray_core.patch_all()
|
xray_core.patch_all()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user