本文整理汇总了Python中twisted.names.dns.Record_AAAA方法的典型用法代码示例。如果您正苦于以下问题:Python dns.Record_AAAA方法的具体用法?Python dns.Record_AAAA怎么用?Python dns.Record_AAAA使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twisted.names.dns
的用法示例。
在下文中一共展示了dns.Record_AAAA方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_hashable
# 需要导入模块: from twisted.names import dns [as 别名]
# 或者: from twisted.names.dns import Record_AAAA [as 别名]
def test_hashable(self):
"""
Instances of all record types are hashable.
"""
records = [
dns.Record_NS, dns.Record_MD, dns.Record_MF, dns.Record_CNAME,
dns.Record_MB, dns.Record_MG, dns.Record_MR, dns.Record_PTR,
dns.Record_DNAME, dns.Record_A, dns.Record_SOA, dns.Record_NULL,
dns.Record_WKS, dns.Record_SRV, dns.Record_AFSDB, dns.Record_RP,
dns.Record_HINFO, dns.Record_MINFO, dns.Record_MX, dns.Record_TXT,
dns.Record_AAAA, dns.Record_A6, dns.Record_NAPTR
]
for k in records:
k1, k2 = k(), k()
hk1 = hash(k1)
hk2 = hash(k2)
self.assertEquals(hk1, hk2, "%s != %s (for %s)" % (hk1,hk2,k))
示例2: test_AAAA
# 需要导入模块: from twisted.names import dns [as 别名]
# 或者: from twisted.names.dns import Record_AAAA [as 别名]
def test_AAAA(self):
"""Test DNS 'AAAA' record queries (IPv6)"""
return self.namesTest(
self.resolver.lookupIPV6Address('test-domain.com'),
[dns.Record_AAAA('AF43:5634:1294:AFCB:56AC:48EF:34C3:01FF', ttl=19283784)]
)
示例3: test_aaaaRecords
# 需要导入模块: from twisted.names import dns [as 别名]
# 或者: from twisted.names.dns import Record_AAAA [as 别名]
def test_aaaaRecords(self):
"""
AAAA records are loaded.
"""
rr = self.successResultOf(
self.auth.lookupIPV6Address(b"example.com")
)[0][0]
self.assertEqual(
dns.Record_AAAA(
u"2001:db8:10::1",
604800,
),
rr.payload,
)
示例4: test_AAAA
# 需要导入模块: from twisted.names import dns [as 别名]
# 或者: from twisted.names.dns import Record_AAAA [as 别名]
def test_AAAA(self):
"""
The byte stream written by L{dns.Record_AAAA.encode} can be used by
L{dns.Record_AAAA.decode} to reconstruct the state of the original
L{dns.Record_AAAA} instance.
"""
self._recordRoundtripTest(dns.Record_AAAA('::1'))
示例5: test_aaaa
# 需要导入模块: from twisted.names import dns [as 别名]
# 或者: from twisted.names.dns import Record_AAAA [as 别名]
def test_aaaa(self):
"""
The repr of a L{dns.Record_AAAA} instance includes the colon-separated
hex string representation of the address it is for and the TTL of the
record.
"""
self.assertEqual(
repr(dns.Record_AAAA('8765::1234', ttl=10)),
"<AAAA address=8765::1234 ttl=10>")
示例6: lookupIPV6Address
# 需要导入模块: from twisted.names import dns [as 别名]
# 或者: from twisted.names.dns import Record_AAAA [as 别名]
def lookupIPV6Address(self, name, timeout=None):
"""
Read any IPv6 addresses from C{self.file} and return them as
L{Record_AAAA} instances.
"""
return self._respond(name, self._aaaaRecords(name))
# Someday this should include IPv6 addresses too, but that will cause
# problems if users of the API (mainly via getHostByName) aren't updated to
# know about IPv6 first.
示例7: testAAAA
# 需要导入模块: from twisted.names import dns [as 别名]
# 或者: from twisted.names.dns import Record_AAAA [as 别名]
def testAAAA(self):
"""Test DNS 'AAAA' record queries (IPv6)"""
return self.namesTest(
self.resolver.lookupIPV6Address('test-domain.com'),
[dns.Record_AAAA('AF43:5634:1294:AFCB:56AC:48EF:34C3:01FF', ttl=19283784)]
)
示例8: testHashable
# 需要导入模块: from twisted.names import dns [as 别名]
# 或者: from twisted.names.dns import Record_AAAA [as 别名]
def testHashable(self):
records = [
dns.Record_NS, dns.Record_MD, dns.Record_MF, dns.Record_CNAME,
dns.Record_MB, dns.Record_MG, dns.Record_MR, dns.Record_PTR,
dns.Record_DNAME, dns.Record_A, dns.Record_SOA, dns.Record_NULL,
dns.Record_WKS, dns.Record_SRV, dns.Record_AFSDB, dns.Record_RP,
dns.Record_HINFO, dns.Record_MINFO, dns.Record_MX, dns.Record_TXT,
dns.Record_AAAA, dns.Record_A6
]
for k in records:
k1, k2 = k(), k()
hk1 = hash(k1)
hk2 = hash(k2)
self.assertEquals(hk1, hk2, "%s != %s (for %s)" % (hk1,hk2,k))
示例9: _aaaaRecords
# 需要导入模块: from twisted.names import dns [as 别名]
# 或者: from twisted.names.dns import Record_AAAA [as 别名]
def _aaaaRecords(self, name, address):
return tuple([dns.RRHeader(name, dns.AAAA, dns.IN, self.minTTL,
dns.Record_AAAA(address, self.minTTL))])