Commit 691d752f authored by Jason Toffaletti's avatar Jason Toffaletti

some basic dns tests

--HG--
extra : transplant_source : %876%5Dg%BE%D6%1E5%3C2%BF%2A%D8a%0B%D5%FAU%0A-
parent 2cff4359
#!/usr/bin/python
from gevent import monkey; monkey.patch_all()
from gevent import socket
import unittest
class GetAddrInfoTest(unittest.TestCase):
def test_localhost(self):
socket.getaddrinfo('localhost', 0)
socket.getaddrinfo('127.0.0.1', 0)
def test_google(self):
socket.getaddrinfo('www.google.com', 80)
class GetNameInfoTest(unittest.TestCase):
def test_localhost(self):
socket.getnameinfo(('127.0.0.1', 0), 0)
def test_google(self):
socket.getnameinfo(('74.125.19.105', 80), 0)
class GetHostByNameTest(unittest.TestCase):
def test_localhost(self):
socket.gethostbyname('localhost')
socket.gethostbyname('127.0.0.1')
def test_google(self):
socket.gethostbyname('www.google.com')
if __name__ == "__main__":
unittest.main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment