Exemplo n.º 1
0
 def test_batch_consistent_read_defaults_to_false(self):
     b = Batch(self.table, ['k1'])
     self.assertDictEqual(
         b.to_dict(),
         {'Keys': [{'HashKeyElement': {'S': 'k1'}}],
          'ConsistentRead': False}
     )
Exemplo n.º 2
0
 def test_batch_to_dict(self):
     b = Batch(self.table, ['k1', 'k2'], attributes_to_get=['foo'],
               consistent_read=True)
     self.assertDictEqual(
         b.to_dict(),
         {'AttributesToGet': ['foo'],
          'Keys': [{'HashKeyElement': {'S': 'k1'}},
                   {'HashKeyElement': {'S': 'k2'}}],
          'ConsistentRead': True}
     )
Exemplo n.º 3
0
 def test_batch_consistent_read_defaults_to_false(self):
     b = Batch(self.table, ['k1'])
     self.assertDictEqual(b.to_dict(), {
         'Keys': [{
             'HashKeyElement': {
                 'S': 'k1'
             }
         }],
         'ConsistentRead': False
     })
Exemplo n.º 4
0
 def test_batch_to_dict(self):
     b = Batch(self.table, ['k1', 'k2'],
               attributes_to_get=['foo'],
               consistent_read=True)
     self.assertDictEqual(
         b.to_dict(), {
             'AttributesToGet': ['foo'],
             'Keys': [{
                 'HashKeyElement': {
                     'S': 'k1'
                 }
             }, {
                 'HashKeyElement': {
                     'S': 'k2'
                 }
             }],
             'ConsistentRead':
             True
         })