tests fix
This commit is contained in:
parent
137195c8f2
commit
9f87f3dc3e
@ -54,18 +54,19 @@ class TestEncryption:
|
|||||||
tox = tox_factory()
|
tox = tox_factory()
|
||||||
data = tox.get_savedata()
|
data = tox.get_savedata()
|
||||||
lib = encr.ToxEncryptSave()
|
lib = encr.ToxEncryptSave()
|
||||||
lib.set_password('easypassword')
|
for password in ('easypassword', 'njvnjfnvaGGV6', 'toxygen'):
|
||||||
copy_data = data[:]
|
lib.set_password(password)
|
||||||
data = lib.pass_encrypt(data)
|
copy_data = data[:]
|
||||||
data = lib.pass_decrypt(data)
|
new_data = lib.pass_encrypt(data)
|
||||||
assert copy_data == data
|
new_data = lib.pass_decrypt(new_data)
|
||||||
|
assert copy_data == new_data
|
||||||
|
|
||||||
|
|
||||||
class TestFriend:
|
class TestFriend:
|
||||||
|
|
||||||
def create_singletons(self):
|
def create_singletons(self):
|
||||||
Settings._instance = Settings.get_default_settings()
|
Settings._instance = Settings.get_default_settings()
|
||||||
ProfileHelper('', 'test')
|
ProfileHelper('abc', 'test')
|
||||||
|
|
||||||
def create_friend(self, name, status_message, number, tox_id):
|
def create_friend(self, name, status_message, number, tox_id):
|
||||||
friend = Friend(None, number, name, status_message, None, tox_id)
|
friend = Friend(None, number, name, status_message, None, tox_id)
|
||||||
|
@ -45,7 +45,7 @@ def convert_time(t):
|
|||||||
|
|
||||||
|
|
||||||
def append_slash(s):
|
def append_slash(s):
|
||||||
if s[-1] not in ('\\', '/'):
|
if len(s) and s[-1] not in ('\\', '/'):
|
||||||
s += '/'
|
s += '/'
|
||||||
return s
|
return s
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user