def test_uri_https(self):
# =======================================================
# Default port, implicit
# =======================================================
req = Request(testing.create_environ(
path='/hello', scheme='https'))
uri = ('https://' + testing.DEFAULT_HOST + '/hello')
assert req.uri == uri
# =======================================================
# Default port, explicit
# =======================================================
req = Request(testing.create_environ(
path='/hello', scheme='https', port=443))
uri = ('https://' + testing.DEFAULT_HOST + '/hello')
assert req.uri == uri
# =======================================================
# Non-default port
# =======================================================
req = Request(testing.create_environ(
path='/hello', scheme='https', port=22))
uri = ('https://' + testing.DEFAULT_HOST + ':22/hello')
assert req.uri == uri
评论列表
文章目录