Ejemplo n.º 1
0
 def testFlushWithTooLargeRequestError(self):
     self.list = context._ItemList(
         self.max_entity_count,
         FlushFunction().flush_function_too_large_error,
         repr_function=lambda item: item)
     items = [(s, 'a' * s) for s in range(10, 1, -1)]
     items_copy = list(items)
     random.seed(1)
     random.shuffle(items_copy)
     for _, i in items_copy:
         self.list.append(i)
     self.assertRaises(apiproxy_errors.RequestTooLargeError,
                       self.list.flush)
     self.assertEqual(items[:context._ItemList._LARGEST_ITEMS_TO_LOG],
                      self.list._largest)
Ejemplo n.º 2
0
 def testFlushWithTooLargeRequestError(self):
   self.list = context._ItemList(
       self.max_entity_count,
       FlushFunction().flush_function_too_large_error,
       repr_function=lambda item: item)
   items = [(s, 'a'*s) for s in range(10, 1, -1)]
   items_copy = list(items)
   random.seed(1)
   random.shuffle(items_copy)
   for _, i in items_copy:
     self.list.append(i)
   self.assertRaises(apiproxy_errors.RequestTooLargeError,
                     self.list.flush)
   self.assertEqual(items[:context._ItemList._LARGEST_ITEMS_TO_LOG],
                    self.list._largest)
Ejemplo n.º 3
0
 def setUp(self):
     FlushFunction.reset()
     self.max_entity_count = 9
     self.list = context._ItemList(self.max_entity_count,
                                   FlushFunction().flush_function)
Ejemplo n.º 4
0
 def setUp(self):
   FlushFunction.reset()
   self.max_entity_count = 9
   self.list = context._ItemList(
       self.max_entity_count,
       FlushFunction().flush_function)