Testing new version of decorator.

This commit is contained in:
Steve Pulec 2017-02-15 22:35:45 -05:00
commit fde721bed7
123 changed files with 2740 additions and 1114 deletions

View file

@ -7,13 +7,13 @@ import requests
import tests.backport_assert_raises
from nose.tools import assert_raises
from moto import mock_dynamodb
from moto import mock_dynamodb, mock_dynamodb_deprecated
from moto.dynamodb import dynamodb_backend
from boto.exception import DynamoDBResponseError
@mock_dynamodb
@mock_dynamodb_deprecated
def test_list_tables():
name = 'TestTable'
dynamodb_backend.create_table(name, hash_key_attr="name", hash_key_type="S")
@ -21,7 +21,7 @@ def test_list_tables():
assert conn.list_tables() == ['TestTable']
@mock_dynamodb
@mock_dynamodb_deprecated
def test_list_tables_layer_1():
dynamodb_backend.create_table("test_1", hash_key_attr="name", hash_key_type="S")
dynamodb_backend.create_table("test_2", hash_key_attr="name", hash_key_type="S")
@ -35,7 +35,7 @@ def test_list_tables_layer_1():
res.should.equal(expected)
@mock_dynamodb
@mock_dynamodb_deprecated
def test_describe_missing_table():
conn = boto.connect_dynamodb('the_key', 'the_secret')
with assert_raises(DynamoDBResponseError):
@ -49,7 +49,7 @@ def test_sts_handler():
res.text.should.contain("SecretAccessKey")
@mock_dynamodb
@mock_dynamodb_deprecated
def test_dynamodb_with_connect_to_region():
# this will work if connected with boto.connect_dynamodb()
dynamodb = boto.dynamodb.connect_to_region('us-west-2')