def test_SRVNoService(self):
"""
Test that connecting fails when no service is present.
"""
payload = dns.Record_SRV(port=5269, target=b'.', ttl=60)
client.theResolver.results = [dns.RRHeader(name='example.org',
type=dns.SRV,
cls=dns.IN, ttl=60,
payload=payload)]
self.connector.connect()
self.assertIsNotNone(self.factory.reason)
self.factory.reason.trap(DNSLookupError)
self.assertEqual(self.reactor.tcpClients, [])
评论列表
文章目录