MCPcopy Create free account
hub / github.com/FreeOpcUa/python-opcua / setUpClass

Method setUpClass

tests/tests_crypto_connect.py:29–52  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

27 '''
28 @classmethod
29 def setUpClass(cls):
30 # start our own server
31 cls.srv_crypto = Server()
32 cls.uri_crypto = 'opc.tcp://127.0.0.1:{0:d}'.format(port_num1)
33 cls.srv_crypto.set_endpoint(cls.uri_crypto)
34 # load server certificate and private key. This enables endpoints
35 # with signing and encryption.
36 cls.srv_crypto.load_certificate("examples/certificate-example.der")
37 cls.srv_crypto.load_private_key("examples/private-key-example.pem")
38 cls.srv_crypto.start()
39
40 # start a server without crypto
41 cls.srv_no_crypto = Server()
42 cls.uri_no_crypto = 'opc.tcp://127.0.0.1:{0:d}'.format(port_num2)
43 cls.srv_no_crypto.set_endpoint(cls.uri_no_crypto)
44 cls.srv_no_crypto.start()
45
46 # start server with long key
47 cls.srv_crypto2 = Server()
48 cls.uri_crypto2 = 'opc.tcp://127.0.0.1:{0:d}'.format(port_num3)
49 cls.srv_crypto2.set_endpoint(cls.uri_crypto2)
50 cls.srv_crypto2.load_certificate("examples/certificate-3072-example.der")
51 cls.srv_crypto2.load_private_key("examples/private-key-3072-example.pem")
52 cls.srv_crypto2.start()
53
54 @classmethod
55 def tearDownClass(cls):

Callers

nothing calls this directly

Calls 5

ServerClass · 0.90
set_endpointMethod · 0.80
load_certificateMethod · 0.80
load_private_keyMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected