Esempio n. 1
0
 def test_rate_limited_scan(self):
     """
     TableConnection.rate_limited_scan
     """
     conn = TableConnection(self.test_table_name)
     with patch('pynamodb.connection.Connection.rate_limited_scan') as req:
         req.return_value = {}
         conn.rate_limited_scan(
             attributes_to_get='attributes_to_get',
             page_size=1,
             limit=2,
             conditional_operator='AND',
             scan_filter={'filter': 'X'},
             segment=2,
             total_segments=4,
             exclusive_start_key='EX',
             timeout_seconds=11,
             read_capacity_to_consume_per_second=12,
             allow_rate_limited_scan_without_consumed_capacity=False,
             max_sleep_between_retry=3,
             max_consecutive_exceptions=7,
             consistent_read=True,
             index_name='index')
         self.assertEqual(self.test_table_name, req.call_args[0][0])
         params = {
             'filter_condition': None,
             'attributes_to_get': 'attributes_to_get',
             'page_size': 1,
             'limit': 2,
             'conditional_operator': 'AND',
             'scan_filter': {
                 'filter': 'X'
             },
             'segment': 2,
             'total_segments': 4,
             'exclusive_start_key': 'EX',
             'timeout_seconds': 11,
             'read_capacity_to_consume_per_second': 12,
             'allow_rate_limited_scan_without_consumed_capacity': False,
             'max_sleep_between_retry': 3,
             'max_consecutive_exceptions': 7,
             'consistent_read': True,
             'index_name': 'index'
         }
         self.assertEqual(params, req.call_args[1])
Esempio n. 2
0
 def test_rate_limited_scan(self):
     """
     TableConnection.rate_limited_scan
     """
     conn = TableConnection(self.test_table_name)
     with patch('pynamodb.connection.Connection.rate_limited_scan') as req:
         req.return_value = {}
         conn.rate_limited_scan(attributes_to_get='attributes_to_get',
             page_size=1,
             limit=2,
             conditional_operator='AND',
             scan_filter={'filter': 'X'},
             segment=2,
             total_segments=4,
             exclusive_start_key='EX',
             timeout_seconds=11,
             read_capacity_to_consume_per_second=12,
             allow_rate_limited_scan_without_consumed_capacity=False,
             max_sleep_between_retry=3,
             max_consecutive_exceptions=7,
             consistent_read=True,
             index_name='index'
         )
         self.assertEqual(self.test_table_name, req.call_args[0][0])
         params = {
             'filter_condition': None,
             'attributes_to_get': 'attributes_to_get',
             'page_size': 1,
             'limit': 2,
             'conditional_operator': 'AND',
             'scan_filter': {'filter': 'X'},
             'segment': 2,
             'total_segments': 4,
             'exclusive_start_key': 'EX',
             'timeout_seconds': 11,
             'read_capacity_to_consume_per_second': 12,
             'allow_rate_limited_scan_without_consumed_capacity': False,
             'max_sleep_between_retry': 3,
             'max_consecutive_exceptions': 7,
             'consistent_read': True,
             'index_name': 'index'
         }
         self.assertEqual(params, req.call_args[1])