tests fix
This commit is contained in:
parent
4fb0886452
commit
b3ed257826
@ -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
|
||||
|
||||
|
@ -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))
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user