From b3ed257826573c3e0b2d8323bb0f39ec25a29521 Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Sat, 27 Feb 2016 18:52:27 +0300 Subject: [PATCH] tests fix --- src/mainscreen.py | 2 +- src/profile.py | 4 ++-- tests/tests.py | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/mainscreen.py b/src/mainscreen.py index 81173b0..3ce48f2 100644 --- a/src/mainscreen.py +++ b/src/mainscreen.py @@ -3,7 +3,7 @@ import sys from PySide import QtGui, QtCore from menu import * -from profile import Profile +from profile import * from toxcore_enums_and_consts import * from util import curr_time diff --git a/src/profile.py b/src/profile.py index c71086f..e032ef0 100644 --- a/src/profile.py +++ b/src/profile.py @@ -1,4 +1,4 @@ -import mainscreen +from mainscreen import * from settings import Settings from PySide import QtCore, QtGui import os @@ -167,7 +167,7 @@ class Profile(Contact): def newMessage(self, id, message_type, message): if id == self._active_friend: # add message to list user_name = Profile.getInstance().getActiveName() - item = mainscreen.MessageItem(message, curr_time(), user_name) + item = MessageItem(message, curr_time(), user_name) elem = QtGui.QListWidgetItem(self._messages) print item.sizeHint() elem.setSizeHint(QtCore.QSize(500, 100)) diff --git a/tests/tests.py b/tests/tests.py index a7e087b..c8f7e75 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -2,7 +2,7 @@ from src.settings import Settings from src.util import bin_to_string, string_to_bin import sys from src.bootstrap import node_generator -from src.profile import ProfileHelper, tox_factory +from src.profile import * import os @@ -60,7 +60,7 @@ class TestNodeGen(): class TestTox(): def test_loading(self): - data = ProfileHelper.open_profile(Settings.get_default_path(), 'tox_save') + data = ProfileHelper.open_profile(Settings.get_default_path(), 'alice') settings = Settings.get_default_settings() tox = tox_factory(data, settings) for data in node_generator(): @@ -68,11 +68,11 @@ class TestTox(): del tox def test_friend_list(self): - data = ProfileHelper.open_profile(Settings.get_default_path(), 'tox_save') + data = ProfileHelper.open_profile(Settings.get_default_path(), 'bob') settings = Settings.get_default_settings() tox = tox_factory(data, settings) s = tox.self_get_friend_list() size = tox.self_get_friend_list_size() - assert size - assert s + assert size == 2 + assert len(s) == 2 del tox