当前位置: 首页>>代码示例>>Python>>正文


Python dns.Record_AAAA方法代码示例

本文整理汇总了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)) 
开发者ID:kuri65536,项目名称:python-for-android,代码行数:20,代码来源:test_dns.py

示例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)]
        ) 
开发者ID:proxysh,项目名称:Safejumper-for-Desktop,代码行数:8,代码来源:test_names.py

示例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,
        ) 
开发者ID:proxysh,项目名称:Safejumper-for-Desktop,代码行数:16,代码来源:test_names.py

示例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')) 
开发者ID:proxysh,项目名称:Safejumper-for-Desktop,代码行数:9,代码来源:test_dns.py

示例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>") 
开发者ID:proxysh,项目名称:Safejumper-for-Desktop,代码行数:11,代码来源:test_dns.py

示例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. 
开发者ID:proxysh,项目名称:Safejumper-for-Desktop,代码行数:12,代码来源:hosts.py

示例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)]
        ) 
开发者ID:kuri65536,项目名称:python-for-android,代码行数:8,代码来源:test_names.py

示例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)) 
开发者ID:kenorb-contrib,项目名称:BitTorrent,代码行数:17,代码来源:test_dns.py

示例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))]) 
开发者ID:skyline75489,项目名称:SimpleDNS,代码行数:5,代码来源:dnsproxy.py


注:本文中的twisted.names.dns.Record_AAAA方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。