diff options
author | animalize <animalize@users.noreply.github.com> | 2018-02-26 18:10:36 (GMT) |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2018-02-26 18:10:36 (GMT) |
commit | 19e7d48ce89422091f9af93038b9fee075d46e9e (patch) | |
tree | edb6bbcbf2c7658f14be062ea4fe1c17dd44c78e /Lib/test/test_socket.py | |
parent | 3f2e6f15d64d81633b1fc0b308afc0d6e9026b61 (diff) | |
download | cpython-19e7d48ce89422091f9af93038b9fee075d46e9e.zip cpython-19e7d48ce89422091f9af93038b9fee075d46e9e.tar.gz cpython-19e7d48ce89422091f9af93038b9fee075d46e9e.tar.bz2 |
bpo-32394: Remove some TCP options on old version Windows. (GH-5523)
Diffstat (limited to 'Lib/test/test_socket.py')
-rw-r--r-- | Lib/test/test_socket.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index b0e1b74..bff1dc2 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -5945,6 +5945,27 @@ class LinuxKernelCryptoAPI(unittest.TestCase): with self.assertRaises(TypeError): sock.sendmsg_afalg(op=socket.ALG_OP_ENCRYPT, assoclen=-1) +@unittest.skipUnless(sys.platform.startswith("win"), "requires Windows") +class TestMSWindowsTCPFlags(unittest.TestCase): + knownTCPFlags = { + # avaliable since long time ago + 'TCP_MAXSEG', + 'TCP_NODELAY', + # available starting with Windows 10 1607 + 'TCP_FASTOPEN', + # available starting with Windows 10 1703 + 'TCP_KEEPCNT', + # available starting with Windows 10 1709 + 'TCP_KEEPIDLE', + 'TCP_KEEPINTVL' + } + + def test_new_tcp_flags(self): + provided = [s for s in dir(socket) if s.startswith('TCP')] + unknown = [s for s in provided if s not in self.knownTCPFlags] + + self.assertEqual([], unknown, + "New TCP flags were discovered. See bpo-32394 for more information") def test_main(): tests = [GeneralModuleTests, BasicTCPTest, TCPCloserTest, TCPTimeoutTest, @@ -6005,6 +6026,7 @@ def test_main(): SendfileUsingSendTest, SendfileUsingSendfileTest, ]) + tests.append(TestMSWindowsTCPFlags) thread_info = support.threading_setup() support.run_unittest(*tests) |