Commit f318b6d2 authored by Jason Madden's avatar Jason Madden

Testing the attributes, need to see what they are under linux.

parent d07e4bb6
......@@ -185,6 +185,20 @@ class TestTCP(greentest.TestCase):
fd.close()
acceptor.join()
def test_attributes(self):
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 0)
print("Socket type", s.type)
self.assertEqual(socket.AF_INET, s.type)
self.assertEqual(socket.SOCK_DGRAM, s.family)
self.assertEqual(0, s.proto)
if hasattr(socket, 'SOCK_NONBLOCK'):
print("Has non-block")
s.settimeout(1)
print("Socket type with timeout", s.type)
self.assertEqual(socket.AF_INET, s.type)
def get_port():
tempsock = socket.socket()
......
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