

def _check_map_reduce(self, colc, expected_results):
    result = colc.map_reduce(self.map_func, self.reduce_func, 'myresults')
    self.assertTrue(isinstance(result, mongomock.Collection))
    self.assertEqual(result.name, 'myresults')
    self.assertEqual(result.count(), len(expected_results))
    for doc in result.find():
        self.assertIn(doc, expected_results)

dataset/ETHPy150Open vmalloc/mongomock/tests/test__mongomock.py CollectionMapReduceTest._check_map_reduce/original