本文整理汇总了Python中botocore.awsrequest.AWSHTTPConnection._tunnel方法的典型用法代码示例。如果您正苦于以下问题:Python AWSHTTPConnection._tunnel方法的具体用法?Python AWSHTTPConnection._tunnel怎么用?Python AWSHTTPConnection._tunnel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类botocore.awsrequest.AWSHTTPConnection
的用法示例。
在下文中一共展示了AWSHTTPConnection._tunnel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_tunnel_uses_std_lib
# 需要导入模块: from botocore.awsrequest import AWSHTTPConnection [as 别名]
# 或者: from botocore.awsrequest.AWSHTTPConnection import _tunnel [as 别名]
def test_tunnel_uses_std_lib(self):
s = FakeSocket(b'HTTP/1.1 200 OK\r\n')
conn = AWSHTTPConnection('s3.amazonaws.com', 443)
conn.sock = s
# Test that the standard library method was used by patching out
# the ``_tunnel`` method and seeing if the std lib method was called.
with patch('urllib3.connection.HTTPConnection._tunnel') as mock_tunnel:
conn._tunnel()
self.assertTrue(mock_tunnel.called)