def testGetAllNonMatchingNoEntities(self): """Test that non matching returns an empty list. """ query = TestModel.all() query.filter('value >', 5) expected = [] actual = self.logic.getAll(query=query) self.assertEqual(expected, actual)
def testGetAllNonMatchingNoEntities(self): """Test that non matching returns an empty list. """ query = TestModel.all() query.filter('value >', 5) expected = [] actual = self.logic.getAll(query = query) self.assertEqual(expected, actual)
def testGetAllNoEntities(self): """Test that it returns an empty list when there is no entity in datastore. """ for entity in self.entities: entity .delete() query = TestModel.all() expected = [] actual = self.logic.getAll(query = query) self.assertEqual(expected, actual)
def testDeleteNotExisted(self): """Test that deleting a not existed entry does not affects the data store. """ entity = TestModel(key_name='test/%d' % 5, value=5) self.logic.delete(entity) query = TestModel.all() expected = len(self.entities) actual = len(query.fetch(expected)) self.assertEqual(expected, actual)
def testGetAllNoEntities(self): """Test that it returns an empty list when there is no entity in datastore. """ for entity in self.entities: entity.delete() query = TestModel.all() expected = [] actual = self.logic.getAll(query=query) self.assertEqual(expected, actual)
def testGetAll(self): """Test that all entries are retrieved. Note: an error will be raised if there are more than 1k entries in the current implementation. """ query = TestModel.all() expected = set(range(5)) actual = set([i.value for i in self.logic.getAll(query = query)]) self.assertEqual(expected, actual)
def testDelete(self): """Test that entry can be deleted. """ entity = self.entities[0] self.logic.delete(entity) query = TestModel.all() query.filter('value =', 0) expected = None actual = query.get() self.assertEqual(expected, actual)
def testGetAll(self): """Test that all entries are retrieved. Note: an error will be raised if there are more than 1k entries in the current implementation. """ query = TestModel.all() expected = set(range(5)) actual = set([i.value for i in self.logic.getAll(query=query)]) self.assertEqual(expected, actual)