本文整理汇总了Python中aiohttp.client.HttpClient._resolved_hosts[('localhost',123)]方法的典型用法代码示例。如果您正苦于以下问题:Python HttpClient._resolved_hosts[('localhost',123)]方法的具体用法?Python HttpClient._resolved_hosts[('localhost',123)]怎么用?Python HttpClient._resolved_hosts[('localhost',123)]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aiohttp.client.HttpClient
的用法示例。
在下文中一共展示了HttpClient._resolved_hosts[('localhost',123)]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_cleanup_resolved_hosts
# 需要导入模块: from aiohttp.client import HttpClient [as 别名]
# 或者: from aiohttp.client.HttpClient import _resolved_hosts[('localhost',123)] [as 别名]
def test_cleanup_resolved_hosts(self):
loop = unittest.mock.Mock()
c = HttpClient('localhost:8080', loop=loop, resolve=True)
c._resolved_hosts[('localhost', 123)] = object()
loop.call_later.assert_called_with(
c._resolve_timeout, c._cleanup_resolved_host)
loop.reset_mock()
c._cleanup_resolved_host()
self.assertFalse(bool(c._resolved_hosts))
loop.call_later.assert_called_with(
c._resolve_timeout, c._cleanup_resolved_host)