Пример #1
0
 def test_get_url_params_no_request_id(self):
     req = FakeRequest(args={'foo': ['hello', 'bye'], 'bar': ['world']})
     assert Service.get_url_params(req, ['foo'], ['bar', 'baz']) == {
         'foo': 'hello',
         'bar': 'world',
     }
     assert Service.get_request_id(req) is None
Пример #2
0
 def test_get_url_params_with_request_id(self):
     req = FakeRequest(args={
         'request_id': ['req0'],
         'foo': ['hello', 'bye'],
         'bar': ['world'],
     })
     assert Service.get_url_params(req, ['request_id', 'foo', 'bar']) == {
         'request_id': 'req0',
         'foo': 'hello',
         'bar': 'world',
     }
     assert Service.get_request_id(req) == 'req0'
Пример #3
0
 def test_request_id(self):
     req = FakeRequest()
     assert Service.get_request_id(req) is None
     Service.set_request_id(req, 'foo')
     assert Service.get_request_id(req) == 'foo'