def test_updatePet(self):
        req, _ = app.op['updatePet'](body=dict(id=1, name='Mary', category=dict(id=1, name='dog')))
        req.prepare()

        self.assertEqual(req.method, 'put')
        self.assertEqual(req.header, {'Content-Type': 'application/json', 'Accept': 'application/json'})
        self.assertEqual(req.url, 'http://petstore.swagger.wordnik.com/api/pet')
        self.assertEqual(req.path, '/api/pet')
        self.assertEqual(req.base_path, '')
        self.assertEqual(req.query, [])

        m = req._p['body']['body']
        self.assertTrue(isinstance(m, Model))
        self.assertEqual(m.id, 1)
        self.assertEqual(m.name, 'Mary')
        self.assertTrue(isinstance(m.category, Model))
        self.assertEqual(m.category.id, 1)
        self.assertEqual(m.category.name, 'dog')
Pet.updatePet
dataset/ETHPy150Open mission-liao/pyswagger/pyswagger/tests/v1_2/test_io.py/SwaggerRequest_Pet_TestCase.test_updatePet