(self, file_server)
| 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) |
| 56 | assert file_server != client |
| 57 | |
| 58 | # Remove all supported crypto |
| 59 | crypt_supported_bk = CryptConnection.manager.crypt_supported |
| 60 | CryptConnection.manager.crypt_supported = [] |
| 61 | |
| 62 | with mock.patch('Config.config.ip_local', return_value=[]): # SSL not used for local ips |
| 63 | connection = client.getConnection(file_server.ip, 1544) |
| 64 | assert len(file_server.connections) == 1 |
| 65 | assert not connection.crypt |
| 66 | |
| 67 | # Close connection |
| 68 | connection.close() |
| 69 | client.stop() |
| 70 | time.sleep(0.01) |
| 71 | assert len(file_server.connections) == 0 |
| 72 | |
| 73 | # Reset supported crypts |
| 74 | CryptConnection.manager.crypt_supported = crypt_supported_bk |
| 75 | |
| 76 | def testPing(self, file_server, site): |
| 77 | client = ConnectionServer(file_server.ip, 1545) |
nothing calls this directly
no test coverage detected