diff options
author | Ethan Furman <ethan@stoneleaf.us> | 2015-03-19 01:19:30 (GMT) |
---|---|---|
committer | Ethan Furman <ethan@stoneleaf.us> | 2015-03-19 01:19:30 (GMT) |
commit | 482fe0477e5923f0b8fff16c59052650cf7247cf (patch) | |
tree | 0b2ee2281894cda0a745373a8a5df9569a33ec55 /Lib/test/test_socket.py | |
parent | d833779ceaebeb29352488ffddabf5fc2f070364 (diff) | |
download | cpython-482fe0477e5923f0b8fff16c59052650cf7247cf.zip cpython-482fe0477e5923f0b8fff16c59052650cf7247cf.tar.gz cpython-482fe0477e5923f0b8fff16c59052650cf7247cf.tar.bz2 |
issue23673
add private method to enum to support replacing global constants with Enum members:
- search for candidate constants via supplied filter
- create new enum class and members
- insert enum class and replace constants with members via supplied module name
- replace __reduce_ex__ with function that returns member name, so previous Python versions can unpickle
modify IntEnum classes to use new method
Diffstat (limited to 'Lib/test/test_socket.py')
-rw-r--r-- | Lib/test/test_socket.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index b412386..0db760f 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -1375,6 +1375,11 @@ class GeneralModuleTests(unittest.TestCase): with sock: for protocol in range(pickle.HIGHEST_PROTOCOL + 1): self.assertRaises(TypeError, pickle.dumps, sock, protocol) + for protocol in range(pickle.HIGHEST_PROTOCOL + 1): + family = pickle.loads(pickle.dumps(socket.AF_INET, protocol)) + self.assertEqual(family, socket.AF_INET) + type = pickle.loads(pickle.dumps(socket.SOCK_STREAM, protocol)) + self.assertEqual(type, socket.SOCK_STREAM) def test_listen_backlog(self): for backlog in 0, -1: |