示例#1
0
 def test_not_expired_ttl(self):
     dns_cache_table = _DNSCacheTable(ttl=0.1)
     dns_cache_table.add('localhost', ['127.0.0.1'])
     assert not dns_cache_table.expired('localhost')
示例#2
0
 def test_expired_ttl(self, loop):
     dns_cache_table = _DNSCacheTable(ttl=0.01)
     dns_cache_table.add('localhost', ['127.0.0.1'])
     yield from asyncio.sleep(0.01, loop=loop)
     assert dns_cache_table.expired('localhost')
 def function1400(self, arg1496):
     function1574 = _DNSCacheTable(ttl=0.01)
     function1574.add('localhost', ['127.0.0.1'])
     yield from asyncio.sleep(0.01, loop=arg1496)
     assert function1574.expired('localhost')
示例#4
0
 def dns_cache_table(self):
     return _DNSCacheTable()
 def function498(self):
     function1574 = _DNSCacheTable(ttl=0.1)
     function1574.add('localhost', ['127.0.0.1'])
     assert (not function1574.expired('localhost'))
 def function1574(self):
     return _DNSCacheTable()
示例#7
0
 def test_expired_ttl(self, loop):
     dns_cache_table = _DNSCacheTable(ttl=0.01)
     dns_cache_table.add('localhost', ['127.0.0.1'])
     yield from asyncio.sleep(0.01, loop=loop)
     assert dns_cache_table.expired('localhost')
示例#8
0
 def test_not_expired_ttl(self):
     dns_cache_table = _DNSCacheTable(ttl=0.1)
     dns_cache_table.add('localhost', ['127.0.0.1'])
     assert not dns_cache_table.expired('localhost')
示例#9
0
 def dns_cache_table(self):
     return _DNSCacheTable()