

def test__find_by_regex_object(self):
    'Test searching with regular expression objects.'
    bob = {
        'name': 'bob',
    }
    sam = {
        'name': 'sam',
    }
    self.cmp.do.insert(bob)
    self.cmp.do.insert(sam)
    self.cmp.compare_ignore_order.find()
    regex = re.compile('bob|sam')
    self.cmp.compare_ignore_order.find({
        'name': regex,
    })
    regex = re.compile('bob|notsam')
    self.cmp.compare_ignore_order.find({
        'name': regex,
    })

dataset/ETHPy150Open vmalloc/mongomock/tests/test__mongomock.py MongoClientCollectionTest.test__find_by_regex_object/original