Commit 7484e95d authored by Jason Madden's avatar Jason Madden

test__socket: Now that we are guaranteed to be using enums for .type and...

test__socket: Now that we are guaranteed to be using enums for .type and .family, strengthen the check from == to is.

Fixes #1950.
parent 62b62d2e
......@@ -396,13 +396,13 @@ class TestTCP(greentest.TestCase):
def test_attributes(self):
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 0)
self.assertEqual(socket.AF_INET, s.type)
self.assertEqual(socket.SOCK_DGRAM, s.family)
self.assertIs(s.family, socket.AF_INET)
self.assertEqual(s.type, socket.SOCK_DGRAM)
self.assertEqual(0, s.proto)
if hasattr(socket, 'SOCK_NONBLOCK'):
s.settimeout(1)
self.assertEqual(socket.AF_INET, s.type)
self.assertIs(s.family, socket.AF_INET)
s.setblocking(0)
std_socket = monkey.get_original('socket', 'socket')(socket.AF_INET, socket.SOCK_DGRAM, 0)
......
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