

def test__find_by_dotted_attributes(self):
    'Test seaching with dot notation.'
    green_bowler = {
        'name': 'bob',
        'hat': {
            'color': 'green',
            'type': 'bowler',
        },
    }
    red_bowler = {
        'name': 'sam',
        'hat': {
            'color': 'red',
            'type': 'bowler',
        },
    }
    self.cmp.do.insert(green_bowler)
    self.cmp.do.insert(red_bowler)
    self.cmp.compare_ignore_order.find()
    self.cmp.compare_ignore_order.find({
        'name': 'sam',
    })
    self.cmp.compare_ignore_order.find({
        'hat.color': 'green',
    })
    self.cmp.compare_ignore_order.find({
        'hat.type': 'bowler',
    })
    self.cmp.compare.find({
        'hat.color': 'red',
        'hat.type': 'bowler',
    })
    self.cmp.compare.find({
        'name': 'bob',
        'hat.color': 'red',
        'hat.type': 'bowler',
    })
    self.cmp.compare.find({
        'hat': 'a hat',
    })
    self.cmp.compare.find({
        'hat.color.cat': 'red',
    })

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