示例#1
0
 def _create_client(self):
     bridge = _Bridge()
     with generate_key_cert_pair() as key_cert_pair:
         key_file, cert_file = key_cert_pair
         ssl_ctx = create_ssl_context(key_file, cert_file)
         with constructClient(self.log, bridge, ssl_ctx) as clientFactory:
             json_client = clientFactory()
             try:
                 yield _MockedClient(json_client, CALL_TIMEOUT, False)
             finally:
                 json_client.close()
示例#2
0
 def run(self, result=None):
     with generate_key_cert_pair() as key_cert_pair:
         key_file, cert_file = key_cert_pair
         self.ssl_ctx = create_ssl_context(key_file, cert_file)
         super(TestCaseBase, self).run(result)