コード例 #1
0
 def test_run_dnsexception(self):
     self.mox.StubOutWithMock(dns_resolver, 'query')
     dns_resolver.query(IgnoreArg(), 'PTR').AndRaise(DNSException)
     self.mox.ReplayAll()
     ptr = PtrLookup('127.0.0.1')
     assert_is_instance(ptr, gevent.Greenlet)
     assert_is_none(ptr._run())
コード例 #2
0
 def test_run_dnsexception(self):
     self.mox.StubOutWithMock(dns_resolver, 'query')
     dns_resolver.query(IgnoreArg(), 'PTR').AndRaise(DNSException)
     self.mox.ReplayAll()
     ptr = PtrLookup('127.0.0.1')
     self.assertIsInstance(ptr, gevent.Greenlet)
     self.assertIsNone(ptr._run())
コード例 #3
0
 def test_run_nxdomain(self):
     self.mox.StubOutWithMock(dns_resolver, 'query')
     dns_resolver.query(IgnoreArg(), 'PTR').AndRaise(NXDOMAIN)
     self.mox.ReplayAll()
     ptr = PtrLookup('127.0.0.1')
     self.assertIsInstance(ptr, gevent.Greenlet)
     self.assertIsNone(ptr._run())
コード例 #4
0
 def test_run_greenletexit(self):
     self.mox.StubOutWithMock(socket, 'gethostbyaddr')
     socket.gethostbyaddr('127.0.0.1').AndRaise(gevent.GreenletExit)
     self.mox.ReplayAll()
     ptr = PtrLookup('abcd')
     self.assertIsInstance(ptr, gevent.Greenlet)
     self.assertIsNone(ptr._run())
コード例 #5
0
 def test_run_nxdomain(self):
     self.mox.StubOutWithMock(dns_resolver, 'query')
     dns_resolver.query(IgnoreArg(), 'PTR').AndRaise(NXDOMAIN)
     self.mox.ReplayAll()
     ptr = PtrLookup('127.0.0.1')
     assert_is_instance(ptr, gevent.Greenlet)
     assert_is_none(ptr._run())
コード例 #6
0
 def test_run_greenletexit(self):
     self.mox.StubOutWithMock(socket, "gethostbyaddr")
     socket.gethostbyaddr("127.0.0.1").AndRaise(gevent.GreenletExit)
     self.mox.ReplayAll()
     ptr = PtrLookup("abcd")
     self.assertIsInstance(ptr, gevent.Greenlet)
     self.assertIsNone(ptr._run())
コード例 #7
0
 def test_run_no_result(self):
     self.mox.StubOutWithMock(socket, 'gethostbyaddr')
     socket.gethostbyaddr('127.0.0.1').AndRaise(socket.herror)
     self.mox.ReplayAll()
     ptr = PtrLookup('127.0.0.1')
     self.assertIsInstance(ptr, gevent.Greenlet)
     self.assertIsNone(ptr._run())
コード例 #8
0
 def test_run_dnssyntaxerror(self):
     self.mox.StubOutWithMock(dns_resolver, 'query')
     self.mox.ReplayAll()
     ptr = PtrLookup('abcd')
     assert_is_instance(ptr, gevent.Greenlet)
     assert_is_none(ptr._run())
コード例 #9
0
 def test_run_dnssyntaxerror(self):
     self.mox.StubOutWithMock(dns_resolver, 'query')
     self.mox.ReplayAll()
     ptr = PtrLookup('abcd')
     self.assertIsInstance(ptr, gevent.Greenlet)
     self.assertIsNone(ptr._run())
コード例 #10
0
 def test_run_bad_ip(self):
     self.mox.ReplayAll()
     ptr = PtrLookup('abcd')
     self.assertIsInstance(ptr, gevent.Greenlet)
     self.assertIsNone(ptr._run())
コード例 #11
0
 def test_run_bad_ip(self):
     self.mox.ReplayAll()
     ptr = PtrLookup("abcd")
     self.assertIsInstance(ptr, gevent.Greenlet)
     self.assertIsNone(ptr._run())