# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.names.resolve}. """ from twisted.trial.unittest import TestCase from twisted.names.error import DomainError from twisted.names.resolve import ResolverChain class ResolverChainTests(TestCase): """ Tests for L{twisted.names.resolve.ResolverChain} """ def test_emptyResolversList(self): """ L{ResolverChain._lookup} returns a L{DomainError} failure if its C{resolvers} list is empty. """ r = ResolverChain([]) d = r.lookupAddress('www.example.com') f = self.failureResultOf(d) self.assertIs(f.trap(DomainError), DomainError) def test_emptyResolversListLookupAllRecords(self): """ L{ResolverChain.lookupAllRecords} returns a L{DomainError} failure if its C{resolvers} list is empty. """ r = ResolverChain([]) d = r.lookupAllRecords('www.example.com') f = self.failureResultOf(d) self.assertIs(f.trap(DomainError), DomainError)
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
__pycache__ | Folder | 0755 |
|
|
__init__.py | File | 26 B | 0644 |
|
test_cache.py | File | 4.8 KB | 0644 |
|
test_client.py | File | 39.31 KB | 0644 |
|
test_common.py | File | 4.11 KB | 0644 |
|
test_dns.py | File | 150.45 KB | 0644 |
|
test_examples.py | File | 5.22 KB | 0644 |
|
test_hosts.py | File | 8.35 KB | 0644 |
|
test_names.py | File | 42.09 KB | 0644 |
|
test_resolve.py | File | 1.05 KB | 0644 |
|
test_rfc1982.py | File | 13.66 KB | 0644 |
|
test_rootresolve.py | File | 25.04 KB | 0644 |
|
test_server.py | File | 40.27 KB | 0644 |
|
test_srvconnect.py | File | 9.89 KB | 0644 |
|
test_tap.py | File | 4.84 KB | 0644 |
|
test_util.py | File | 3.82 KB | 0644 |
|