summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-10-12 20:09:02 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-10-12 20:09:02 (GMT)
commitb0182c8ca5a98d2c61f44e87e9b5dc6e8b7a9f30 (patch)
tree4677fbfdcdfb7c90184fb4cfdc66cf5221156521 /Lib/test
parent0518842b692a0f698018e35a0f754118b4762fbd (diff)
downloadcpython-b0182c8ca5a98d2c61f44e87e9b5dc6e8b7a9f30.zip
cpython-b0182c8ca5a98d2c61f44e87e9b5dc6e8b7a9f30.tar.gz
cpython-b0182c8ca5a98d2c61f44e87e9b5dc6e8b7a9f30.tar.bz2
Issue #10075: Add a session_stats() method to SSLContext objects.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_ssl.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index b4ec4d5..bf08f6f 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -391,6 +391,23 @@ class ContextTests(unittest.TestCase):
ctx.load_verify_locations(CERTFILE, CAPATH)
ctx.load_verify_locations(CERTFILE, capath=BYTES_CAPATH)
+ def test_session_stats(self):
+ for proto in PROTOCOLS:
+ ctx = ssl.SSLContext(proto)
+ self.assertEqual(ctx.session_stats(), {
+ 'number': 0,
+ 'connect': 0,
+ 'connect_good': 0,
+ 'connect_renegotiate': 0,
+ 'accept': 0,
+ 'accept_good': 0,
+ 'accept_renegotiate': 0,
+ 'hits': 0,
+ 'misses': 0,
+ 'timeouts': 0,
+ 'cache_full': 0,
+ })
+
class NetworkedTests(unittest.TestCase):