diff options
author | Daniel Lindsley <daniel@toastdriven.com> | 2013-05-09 14:34:44 -0700 |
---|---|---|
committer | Daniel Lindsley <daniel@toastdriven.com> | 2013-05-13 15:28:30 -0700 |
commit | db7f7b97567d0f32c38e294e0648f94c368ff655 (patch) | |
tree | 9c0ba0fd6dadcbaad5c63b22dab088723b8c0208 /tests/integration/dynamodb2 | |
parent | 547d790b1903fd1efd63c85b67d9f3186fdd0319 (diff) | |
download | boto-db7f7b97567d0f32c38e294e0648f94c368ff655.tar.gz |
Added parallel scan support in DynamoDB v2.
Diffstat (limited to 'tests/integration/dynamodb2')
-rw-r--r-- | tests/integration/dynamodb2/test_layer1.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/integration/dynamodb2/test_layer1.py b/tests/integration/dynamodb2/test_layer1.py index 16225ff0..43212676 100644 --- a/tests/integration/dynamodb2/test_layer1.py +++ b/tests/integration/dynamodb2/test_layer1.py @@ -208,6 +208,39 @@ class DynamoDBv2Layer1Test(unittest.TestCase): results = self.dynamodb.scan(self.table_name) self.assertEqual(results['Count'], 1) + # Parallel scan (minus client-side threading). + self.dynamodb.batch_write_item({ + self.table_name: [ + { + 'PutRequest': { + 'Item': { + 'username': {'S': 'johndoe'}, + 'first_name': {'S': 'Johann'}, + 'last_name': {'S': 'Does'}, + 'date_joined': {'N': '1366058000'}, + 'friend_count': {'N': '1'}, + 'friends': {'SS': ['jane']}, + }, + }, + 'PutRequest': { + 'Item': { + 'username': {'S': 'alice'}, + 'first_name': {'S': 'Alice'}, + 'last_name': {'S': 'Expert'}, + 'date_joined': {'N': '1366056800'}, + 'friend_count': {'N': '2'}, + 'friends': {'SS': ['johndoe', 'jane']}, + }, + }, + }, + ] + }) + time.sleep(20) + results = self.dynamodb.scan(self.table_name, segment=0, total_segments=2) + self.assertTrue(results['Count'] in [1, 2]) + results = self.dynamodb.scan(self.table_name, segment=1, total_segments=2) + self.assertTrue(results['Count'] in [1, 2]) + def test_without_range_key(self): result = self.create_table( self.table_name, |