summaryrefslogtreecommitdiff
path: root/Lib/test/test_socket.py
diff options
context:
space:
mode:
authorCharles-François Natali <cf.natali@gmail.com>2013-05-21 10:45:46 +0200
committerCharles-François Natali <cf.natali@gmail.com>2013-05-21 10:45:46 +0200
commitb10c71daa2099c450101e5854fd693a405bec49c (patch)
tree204a6ff70430da1d2d5c00f7a0c3f3b3f38007d4 /Lib/test/test_socket.py
parentc7c333d25d258187d71b6658e90796daba708912 (diff)
downloadcpython-git-b10c71daa2099c450101e5854fd693a405bec49c.tar.gz
Backed out changeset c0f2b038fc12
Diffstat (limited to 'Lib/test/test_socket.py')
-rw-r--r--Lib/test/test_socket.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index cb00c382f6..546d793091 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -4451,7 +4451,7 @@ class TestLinuxAbstractNamespace(unittest.TestCase):
UNIX_PATH_MAX = 108
def testLinuxAbstractNamespace(self):
- address = "\x00python-test-hello\x00\xff"
+ address = b"\x00python-test-hello\x00\xff"
with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as s1:
s1.bind(address)
s1.listen(1)
@@ -4462,7 +4462,7 @@ class TestLinuxAbstractNamespace(unittest.TestCase):
self.assertEqual(s2.getpeername(), address)
def testMaxName(self):
- address = "\x00" + "h" * (self.UNIX_PATH_MAX - 1)
+ address = b"\x00" + b"h" * (self.UNIX_PATH_MAX - 1)
with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as s:
s.bind(address)
self.assertEqual(s.getsockname(), address)
@@ -4472,12 +4472,12 @@ class TestLinuxAbstractNamespace(unittest.TestCase):
with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as s:
self.assertRaises(OSError, s.bind, address)
- def testBytesName(self):
- # Check that an abstract name can be passed as bytes.
+ def testStrName(self):
+ # Check that an abstract name can be passed as a string.
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
try:
- s.bind(b"\x00python\x00test\x00")
- self.assertEqual(s.getsockname(), "\x00python\x00test\x00")
+ s.bind("\x00python\x00test\x00")
+ self.assertEqual(s.getsockname(), b"\x00python\x00test\x00")
finally:
s.close()