本文整理汇总了Python中nuclide_server.NuclideServer.get_server_certificate_files方法的典型用法代码示例。如果您正苦于以下问题:Python NuclideServer.get_server_certificate_files方法的具体用法?Python NuclideServer.get_server_certificate_files怎么用?Python NuclideServer.get_server_certificate_files使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nuclide_server.NuclideServer
的用法示例。
在下文中一共展示了NuclideServer.get_server_certificate_files方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_certificates
# 需要导入模块: from nuclide_server import NuclideServer [as 别名]
# 或者: from nuclide_server.NuclideServer import get_server_certificate_files [as 别名]
def test_get_certificates(self):
gen = NuclideCertificatesGenerator(tempfile.gettempdir(), 'localhost', 'test')
server_9090 = NuclideServer(9090)
ret = server_9090.start(timeout=TIMEOUT, cert=gen.server_cert, key=gen.server_key, ca=gen.ca_cert)
self.assertEquals(ret, 0)
# Verify cert files.
server_cert, server_key, ca = server_9090.get_server_certificate_files()
self.assertEquals(server_cert, gen.server_cert)
self.assertEquals(server_key, gen.server_key)
self.assertEquals(ca, gen.ca_cert)
client_cert, client_key = NuclideServer.get_client_certificate_files(ca)
self.assertEquals(client_cert, gen.client_cert)
self.assertEquals(client_key, gen.client_key)
# Verify same cert files after restart.
server_9090.restart(timeout=TIMEOUT)
server_cert, server_key, ca = server_9090.get_server_certificate_files()
self.assertEquals(server_cert, gen.server_cert)
self.assertEquals(server_key, gen.server_key)
self.assertEquals(ca, gen.ca_cert)