summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_socket.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_socket.py')
-rw-r--r--Lib/test/test_socket.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 1899e78..5a851fc 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -469,6 +469,14 @@ class GeneralModuleTests(unittest.TestCase):
sock.close()
self.assertRaises(socket.error, sock.send, "spam")
+ def testNewGetMethods(self):
+ # testing getfamily(), gettype() and getprotocol()
+ sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.assertEqual(sock.getfamily(), socket.AF_INET)
+ self.assertEqual(sock.gettype(), socket.SOCK_STREAM)
+ self.assertEqual(sock.getproto(), 0)
+ sock.close()
+
class BasicTCPTest(SocketConnectedTest):
def __init__(self, methodName='runTest'):