Add existing bigfiles to piecefield if they were downloaded outside of ZeroNet

This commit is contained in:
shortcutme 2018-03-14 22:21:45 +01:00
parent fbc10b8e32
commit 1189c76691
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
2 changed files with 22 additions and 6 deletions

View file

@ -2,9 +2,11 @@ import time
import gevent
import pytest
import mock
from Crypt import CryptConnection
from Connection import ConnectionServer
from Config import config
@pytest.mark.usefixtures("resetSettings")
@ -15,7 +17,9 @@ class TestConnection:
assert file_server != client
# Connect to myself
connection = client.getConnection("127.0.0.1", 1544)
with mock.patch('Config.config.ip_local', return_value=[]): # SSL not used for local ips
connection = client.getConnection("127.0.0.1", 1544)
assert len(file_server.connections) == 1
assert connection.handshake
assert connection.crypt
@ -35,7 +39,9 @@ class TestConnection:
crypt_supported_bk = CryptConnection.manager.crypt_supported
CryptConnection.manager.crypt_supported = []
connection = client.getConnection("127.0.0.1", 1544)
print "---"
with mock.patch('Config.config.ip_local', return_value=[]): # SSL not used for local ips
connection = client.getConnection("127.0.0.1", 1544)
assert len(file_server.connections) == 1
assert not connection.crypt