本文整理匯總了Python中mamba.web.routing.Router._process方法的典型用法代碼示例。如果您正苦於以下問題:Python Router._process方法的具體用法?Python Router._process怎麽用?Python Router._process使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類mamba.web.routing.Router
的用法示例。
在下文中一共展示了Router._process方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_process_return_objects_json_converted
# 需要導入模塊: from mamba.web.routing import Router [as 別名]
# 或者: from mamba.web.routing.Router import _process [as 別名]
def test_process_return_objects_json_converted(self):
router = Router()
request = request_generator('/test')
class FakeResult(object):
name = 'Test'
type = 'JSON'
resp = router._process(FakeResult(), request)
self.assertIsInstance(resp, response.Ok)
self.assertEqual(resp.subject, {'name': 'Test', 'type': 'JSON'})
示例2: test_process_serialize_object_inside_objects
# 需要導入模塊: from mamba.web.routing import Router [as 別名]
# 或者: from mamba.web.routing.Router import _process [as 別名]
def test_process_serialize_object_inside_objects(self):
import decimal
router = Router()
request = request_generator('/test')
class FakeData(object):
data = 'hdsihas8h9277t27gsj'
pepe = decimal.Decimal('10.0')
class FakeResult(object):
name = 'Test'
data = FakeData()
resp = router._process(FakeResult(), request)
self.assertIsInstance(resp, response.Ok)
self.assertEqual(resp.subject, {
'data': {'pepe': '10.0', 'data': 'hdsihas8h9277t27gsj'},
'name': 'Test'
})
示例3: test_process_return_unknown_on_none_result
# 需要導入模塊: from mamba.web.routing import Router [as 別名]
# 或者: from mamba.web.routing.Router import _process [as 別名]
def test_process_return_unknown_on_none_result(self):
router = Router()
self.assertIsInstance(router._process(None, None), response.Unknown)