MCPcopy
hub / github.com/HelloZeroNet/ZeroNet / testSslConnection

Method testSslConnection

src/Test/TestConnectionServer.py:34–52  ·  view source on GitHub ↗
(self, file_server)

Source from the content-addressed store, hash-verified

32 connection = client.getConnection("127.0.0.1", 1544)
33
34 def testSslConnection(self, file_server):
35 client = ConnectionServer(file_server.ip, 1545)
36 assert file_server != client
37
38 # Connect to myself
39 with mock.patch('Config.config.ip_local', return_value=[]): # SSL not used for local ips
40 connection = client.getConnection(file_server.ip, 1544)
41
42 assert len(file_server.connections) == 1
43 assert connection.handshake
44 assert connection.crypt
45
46
47 # Close connection
48 connection.close("Test ended")
49 client.stop()
50 time.sleep(0.01)
51 assert len(file_server.connections) == 0
52 assert file_server.num_incoming == 2 # One for file_server fixture, one for the test
53
54 def testRawConnection(self, file_server):
55 client = ConnectionServer(file_server.ip, 1545)

Callers

nothing calls this directly

Calls 4

getConnectionMethod · 0.95
stopMethod · 0.95
ConnectionServerClass · 0.90
closeMethod · 0.45

Tested by

no test coverage detected