tests fix
This commit is contained in:
parent
4fb0886452
commit
b3ed257826
@ -3,7 +3,7 @@
|
|||||||
import sys
|
import sys
|
||||||
from PySide import QtGui, QtCore
|
from PySide import QtGui, QtCore
|
||||||
from menu import *
|
from menu import *
|
||||||
from profile import Profile
|
from profile import *
|
||||||
from toxcore_enums_and_consts import *
|
from toxcore_enums_and_consts import *
|
||||||
from util import curr_time
|
from util import curr_time
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import mainscreen
|
from mainscreen import *
|
||||||
from settings import Settings
|
from settings import Settings
|
||||||
from PySide import QtCore, QtGui
|
from PySide import QtCore, QtGui
|
||||||
import os
|
import os
|
||||||
@ -167,7 +167,7 @@ class Profile(Contact):
|
|||||||
def newMessage(self, id, message_type, message):
|
def newMessage(self, id, message_type, message):
|
||||||
if id == self._active_friend: # add message to list
|
if id == self._active_friend: # add message to list
|
||||||
user_name = Profile.getInstance().getActiveName()
|
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)
|
elem = QtGui.QListWidgetItem(self._messages)
|
||||||
print item.sizeHint()
|
print item.sizeHint()
|
||||||
elem.setSizeHint(QtCore.QSize(500, 100))
|
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
|
from src.util import bin_to_string, string_to_bin
|
||||||
import sys
|
import sys
|
||||||
from src.bootstrap import node_generator
|
from src.bootstrap import node_generator
|
||||||
from src.profile import ProfileHelper, tox_factory
|
from src.profile import *
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ class TestNodeGen():
|
|||||||
class TestTox():
|
class TestTox():
|
||||||
|
|
||||||
def test_loading(self):
|
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()
|
settings = Settings.get_default_settings()
|
||||||
tox = tox_factory(data, settings)
|
tox = tox_factory(data, settings)
|
||||||
for data in node_generator():
|
for data in node_generator():
|
||||||
@ -68,11 +68,11 @@ class TestTox():
|
|||||||
del tox
|
del tox
|
||||||
|
|
||||||
def test_friend_list(self):
|
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()
|
settings = Settings.get_default_settings()
|
||||||
tox = tox_factory(data, settings)
|
tox = tox_factory(data, settings)
|
||||||
s = tox.self_get_friend_list()
|
s = tox.self_get_friend_list()
|
||||||
size = tox.self_get_friend_list_size()
|
size = tox.self_get_friend_list_size()
|
||||||
assert size
|
assert size == 2
|
||||||
assert s
|
assert len(s) == 2
|
||||||
del tox
|
del tox
|
||||||
|
Loading…
Reference in New Issue
Block a user