Test for the ResourceInUse exception when double creating

This commit is contained in:
Gavin M. Roy 2016-03-04 09:37:15 -05:00
parent 3e909eb2ba
commit 21bb49fb3a

View file

@ -129,6 +129,17 @@ class CreateTableTests(AsyncTestCase):
with self.assertRaises(exceptions.ValidationException):
yield self.client.create_table(definition)
@testing.gen_test
def test_double_create(self):
definition = self.generic_table_definition()
response = yield self.client.create_table(definition)
self.assertEqual(response['TableName'], definition['TableName'])
self.assertIn(response['TableStatus'],
[dynamodb.TABLE_ACTIVE,
dynamodb.TABLE_CREATING])
with self.assertRaises(exceptions.ResourceInUse):
response = yield self.client.create_table(definition)
class DeleteTableTests(AsyncTestCase):