Exemplo n.º 1
0
 def testMapreduceInactiveObject(self):
     """Delete anything that is not a Mapreduce object."""
     entity = TestEntity(model.MapreduceState.kind(), _app=APP_ID)
     entity['active'] = False
     datastore.Put(entity)
     delete_handler.DeleteEntity(entity.key()).next()
     self.assertTrue(self.mock_delete.called)
Exemplo n.º 2
0
 def testMapreduceActiveObject(self):
     """Do not delete active Mapreduce objects."""
     entity = TestEntity(model.MapreduceState.kind(), _app=APP_ID)
     entity['active'] = True
     datastore.Put(entity)
     self.assertRaises(StopIteration,
                       delete_handler.DeleteEntity(entity.key()).next)
Exemplo n.º 3
0
 def testNormalDeleteWithActive(self):
     """Delete anything that is not a Mapreduce object."""
     entity = TestEntity('testentity', _app=APP_ID)
     entity['active'] = True
     datastore.Put(entity)
     delete_handler.DeleteEntity(entity.key()).next()
     self.assertTrue(self.mock_delete.called)
 def testMapreduceInactiveObject(self):
   """Delete anything that is not a Mapreduce object."""
   entity = TestEntity('MapreduceState', _app=APP_ID)
   entity['active'] = False
   delete_handler.DeleteEntity(entity).next()
   self.assertTrue(self.mock_delete.called)
 def testMapreduceActiveObject(self):
   """Do not delete active Mapreduce objects."""
   entity = TestEntity('MapreduceState', _app=APP_ID)
   entity['active'] = True
   self.assertRaises(StopIteration,
                     delete_handler.DeleteEntity(entity).next)
 def testNormalDeleteWithoutActive(self):
   """Delete anything that is not a Mapreduce object."""
   entity = TestEntity('testentity', _app=APP_ID)
   delete_handler.DeleteEntity(entity).next()
   self.assertTrue(self.mock_delete.called)