From 9f87f3dc3ede9500141c478f843cf60f74c9c8fa Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Tue, 1 Nov 2016 00:24:37 +0300 Subject: [PATCH] tests fix --- tests/tests.py | 13 +++++++------ toxygen/util.py | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/tests.py b/tests/tests.py index 35ee6e3..ca7275c 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -54,18 +54,19 @@ class TestEncryption: tox = tox_factory() data = tox.get_savedata() lib = encr.ToxEncryptSave() - lib.set_password('easypassword') - copy_data = data[:] - data = lib.pass_encrypt(data) - data = lib.pass_decrypt(data) - assert copy_data == data + for password in ('easypassword', 'njvnjfnvaGGV6', 'toxygen'): + lib.set_password(password) + copy_data = data[:] + new_data = lib.pass_encrypt(data) + new_data = lib.pass_decrypt(new_data) + assert copy_data == new_data class TestFriend: def create_singletons(self): Settings._instance = Settings.get_default_settings() - ProfileHelper('', 'test') + ProfileHelper('abc', 'test') def create_friend(self, name, status_message, number, tox_id): friend = Friend(None, number, name, status_message, None, tox_id) diff --git a/toxygen/util.py b/toxygen/util.py index ae104a7..5ea50de 100644 --- a/toxygen/util.py +++ b/toxygen/util.py @@ -45,7 +45,7 @@ def convert_time(t): def append_slash(s): - if s[-1] not in ('\\', '/'): + if len(s) and s[-1] not in ('\\', '/'): s += '/' return s