コード例 #1
0
ファイル: test_batch.py プロジェクト: bcoe/mongate
 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]))
コード例 #2
0
ファイル: test_batch.py プロジェクト: bcoe/mongate
 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])
コード例 #3
0
ファイル: test_batch.py プロジェクト: bcoe/mongate
 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'])