def test_compare(self):
        tmp = {'t': {}}
        obj = {
            'a': [{'g': {'name':'Tom'}}, {'g': {'name': 'Kevin'}}],
            'b': {
                'bb': {},
                'bbb': {'g': {'name': 'Owl'}}
            },
            'c': {
                'cc': [
                    {'g': {'name':'Mary'}}
                ]
            },
            'd': {}
        }
        with TestContext(tmp, 't') as ctx:
            ctx.parse(obj)
        obj1 = tmp['t']

        # make sure ok when compare with self
        self.assertEqual((True, ''), obj1.compare(obj1))

        # make sure diff in list would be captured
        objt = copy.deepcopy(obj)
        objt['a'][0]['g']['name'] = 'Tom1'

        tmp = {'t': {}}
        with TestContext(tmp, 't') as ctx:
            ctx.parse(objt)
        obj2 = tmp['t']
        self.assertEqual((False, 'a/0/g/name'), obj1.compare(obj2))

        # make sure re order in list would be ok
        objt = copy.deepcopy(obj)
        objt['a'][0], objt['a'][1] = objt['a'][1], objt['a'][0]

        tmp = {'t': {}}
        with TestContext(tmp, 't') as ctx:
            ctx.parse(objt)
        obj3 = tmp['t']
        self.assertEqual((False, 'a/0/g/name'), obj1.compare(obj3))

        # make sure diff in dict would be captured
        objt = copy.deepcopy(obj)
        objt['b']['bbb']['g']['name'] = 'Leo'

        tmp = {'t': {}}
        with TestContext(tmp, 't') as ctx:
            ctx.parse(objt)
        obj4 = tmp['t']
        self.assertEqual((False, 'b/bbb/g/name'), obj1.compare(obj4))

        # make sure diff in dict of list would be captured
        objt = copy.deepcopy(obj)
        objt['c']['cc'][0]['g']['name'] = 'Celios'

        tmp = {'t': {}}
        with TestContext(tmp, 't') as ctx:
            ctx.parse(objt)
        obj5 = tmp['t']
        self.assertEqual((False, 'c/cc/0/g/name'), obj1.compare(obj5))

        # make sure diff in dict would be captured
        objt = copy.deepcopy(obj)
        objt['b']['bbbb'] = {'g': {'name': 'Leo'}}

        tmp = {'t': {}}
        with TestContext(tmp, 't') as ctx:
            ctx.parse(objt)
        obj6 = tmp['t']
        self.assertEqual((False, 'b/bbbb'), obj1.compare(obj6))
test compare
dataset/ETHPy150Open mission-liao/pyswagger/pyswagger/tests/test_base.py/SwaggerBaseTestCase.test_compare