MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_bad_server_hostname

Method test_bad_server_hostname

Lib/test/test_ssl.py:1716–1726  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1714
1715
1716 def test_bad_server_hostname(self):
1717 ctx = ssl.create_default_context()
1718 with self.assertRaises(ValueError):
1719 ctx.wrap_bio(ssl.MemoryBIO(), ssl.MemoryBIO(),
1720 server_hostname="")
1721 with self.assertRaises(ValueError):
1722 ctx.wrap_bio(ssl.MemoryBIO(), ssl.MemoryBIO(),
1723 server_hostname=".example.org")
1724 with self.assertRaises(TypeError):
1725 ctx.wrap_bio(ssl.MemoryBIO(), ssl.MemoryBIO(),
1726 server_hostname="example.org\x00evil.com")
1727
1728
1729class MemoryBIOTests(unittest.TestCase):

Callers

nothing calls this directly

Calls 2

wrap_bioMethod · 0.80
assertRaisesMethod · 0.45

Tested by

no test coverage detected