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())
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())
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())
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())
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())
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())
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())
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())
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())
def test_run_bad_ip(self): self.mox.ReplayAll() ptr = PtrLookup('abcd') self.assertIsInstance(ptr, gevent.Greenlet) self.assertIsNone(ptr._run())
def test_run_bad_ip(self): self.mox.ReplayAll() ptr = PtrLookup("abcd") self.assertIsInstance(ptr, gevent.Greenlet) self.assertIsNone(ptr._run())