本文整理匯總了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)