def test_batch_find_with_invalid_characters(self): self._perform_batch_insertion() batch = Batch(self.collection, self.connection) batch.add_find({ 'bar': 'ben & company' }) self.assertEqual(0, len(batch.find()[0]))
def test_batch_find_with_no_results(self): self._perform_batch_insertion() batch = Batch(self.collection, self.connection) batch.add_find({ 'bar': 23434 }) batch.add_find({ 'batch_insert_2': 'abananasdf' }) result = batch.find() self.assertFalse(result[0]) self.assertFalse(result[1])
def test_batch_find(self): self._perform_batch_insertion() batch = Batch(self.collection, self.connection) batch.add_find({ 'bar': 2 }) batch.add_find({ 'batch_insert_2': 'banana' }) result = batch.find() self.assertEqual(2, len(result)) self.assertEqual(2, len(result[0])) self.assertEqual('apple', result[1][0]['banana'])