summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaulo Almeida <paulo.ubuntu@gmail.com>2015-02-03 01:28:09 -0200
committerPaulo Almeida <paulo.ubuntu@gmail.com>2015-02-03 01:29:44 -0200
commitf59efcafc3c442e038852608d2636884d1d87b11 (patch)
tree1dd06ad2d36e0bd3cf5c0d4b6ac4570fb57e89c0 /tests
parent1693a30449ef30d93b3c5d728a2365238645591b (diff)
downloadboto-f59efcafc3c442e038852608d2636884d1d87b11.tar.gz
Added a few assertions to test_highlevel.py
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/dynamodb2/test_highlevel.py42
1 files changed, 40 insertions, 2 deletions
diff --git a/tests/integration/dynamodb2/test_highlevel.py b/tests/integration/dynamodb2/test_highlevel.py
index b663ee0d..83340078 100644
--- a/tests/integration/dynamodb2/test_highlevel.py
+++ b/tests/integration/dynamodb2/test_highlevel.py
@@ -719,7 +719,7 @@ class DynamoDBv2Test(unittest.TestCase):
def test_update_table_online_indexing_support(self):
# Create a table using gsi to test the DynamoDB online indexing support
- # https://github.com/boto/boto/issues/2828
+ # https://github.com/boto/boto/pull/2925
users = Table.create('online_indexing_support_users', schema=[
HashKey('user_id')
], throughput={
@@ -740,8 +740,16 @@ class DynamoDBv2Test(unittest.TestCase):
# Wait for it.
time.sleep(60)
+ # Fetch fresh table desc from DynamoDB
+ users.describe()
+
+ # Assert if everything is fine so far
+ self.assertEqual(len(users.global_indexes), 1)
+ self.assertEqual(users.global_indexes[0].throughput['read'], 2)
+ self.assertEqual(users.global_indexes[0].throughput['write'], 2)
+
# Update a GSI throughput. it should work.
- users.update_global_secondary_index(global_index={
+ users.update_global_secondary_index(global_indexes={
'EmailGSIIndex': {
'read': 2,
'write': 1,
@@ -751,6 +759,14 @@ class DynamoDBv2Test(unittest.TestCase):
# Wait for it.
time.sleep(60)
+ # Fetch fresh table desc from DynamoDB
+ users.describe()
+
+ # Assert if everything is fine so far
+ self.assertEqual(len(users.global_indexes), 1)
+ self.assertEqual(users.global_indexes[0].throughput['read'], 2)
+ self.assertEqual(users.global_indexes[0].throughput['write'], 1)
+
# Update a GSI throughput using the old fashion way for compatibility
# purposes. it should work.
users.update(global_indexes={
@@ -763,12 +779,26 @@ class DynamoDBv2Test(unittest.TestCase):
# Wait for it.
time.sleep(60)
+ # Fetch fresh table desc from DynamoDB
+ users.describe()
+
+ # Assert if everything is fine so far
+ self.assertEqual(len(users.global_indexes), 1)
+ self.assertEqual(users.global_indexes[0].throughput['read'], 3)
+ self.assertEqual(users.global_indexes[0].throughput['write'], 2)
+
# Delete a GSI. it should work.
users.delete_global_secondary_index('EmailGSIIndex')
# Wait for it.
time.sleep(60)
+ # Fetch fresh table desc from DynamoDB
+ users.describe()
+
+ # Assert if everything is fine so far
+ self.assertEqual(len(users.global_indexes), 0)
+
# Create a GSI. it should work.
users.create_global_secondary_index(
global_index=GlobalAllIndex(
@@ -781,3 +811,11 @@ class DynamoDBv2Test(unittest.TestCase):
)
# Wait for it. This operation usually takes much longer than the others
time.sleep(60*10)
+
+ # Fetch fresh table desc from DynamoDB
+ users.describe()
+
+ # Assert if everything is fine so far
+ self.assertEqual(len(users.global_indexes), 1)
+ self.assertEqual(users.global_indexes[0].throughput['read'], 1)
+ self.assertEqual(users.global_indexes[0].throughput['write'], 1)