Exemplo n.º 1
0
 def test_result_cb_error(self):
     result = AsyncResult()
     DNSResolver._result_cb(result, 13, pycares.errno.ARES_ENOTFOUND)
     with self.assertRaises(DNSError) as cm:
         result.get()
     self.assertEqual('Domain name not found [ARES_ENOTFOUND]',
                      str(cm.exception))
Exemplo n.º 2
0
 def test_result_cb_error(self):
     result = AsyncResult()
     DNSResolver._result_cb(result, 13, pycares.errno.ARES_ENOTFOUND)
     with self.assertRaises(DNSError) as cm:
         result.get()
     self.assertEqual('Domain name not found [ARES_ENOTFOUND]',
                      str(cm.exception))
Exemplo n.º 3
0
 def test_result_cb(self):
     result = AsyncResult()
     DNSResolver._result_cb(result, 13, None)
     self.assertEqual(13, result.get())
Exemplo n.º 4
0
 def test_result_cb(self):
     result = AsyncResult()
     DNSResolver._result_cb(result, 13, None)
     self.assertEqual(13, result.get())