/usr/lib/python2.7/dist-packages/twisted/names/test/test_resolve.py is in python-twisted-names 14.0.2-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | # 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)
|