Fix test imports
This commit is contained in:
parent
6d1c659b4b
commit
56d002ce34
|
@ -8,10 +8,10 @@ lib.setup_env()
|
|||
|
||||
import nbxmpp
|
||||
|
||||
from common import gajim
|
||||
from common import contacts as contacts_module
|
||||
from common import caps_cache
|
||||
from gajim import Interface
|
||||
from gajim.common import gajim
|
||||
from gajim.common import contacts as contacts_module
|
||||
from gajim.common import caps_cache
|
||||
from gajim.gajim import Interface
|
||||
|
||||
from gajim_mocks import *
|
||||
gajim.logger = MockLogger()
|
||||
|
@ -21,9 +21,9 @@ Interface()
|
|||
import time
|
||||
from data import *
|
||||
|
||||
import roster_window
|
||||
import plugins
|
||||
import notify
|
||||
from gajim import roster_window
|
||||
from gajim import plugins
|
||||
from gajim import notify
|
||||
|
||||
class TestStatusChange(unittest.TestCase):
|
||||
'''tests gajim.py's incredibly complex presence handling'''
|
||||
|
|
|
@ -7,7 +7,7 @@ lib.setup_env()
|
|||
|
||||
from gi.repository import GLib
|
||||
|
||||
from common import resolver
|
||||
from gajim.common import resolver
|
||||
|
||||
from mock import Mock, expectParams
|
||||
from gajim_mocks import *
|
||||
|
|
|
@ -8,9 +8,9 @@ from data import *
|
|||
from mock import Mock, expectParams
|
||||
from gajim_mocks import *
|
||||
|
||||
from common import gajim
|
||||
from common import contacts as contacts_module
|
||||
import roster_window
|
||||
from gajim.common import gajim
|
||||
from gajim.common import contacts as contacts_module
|
||||
from gajim import roster_window
|
||||
|
||||
gajim.get_jid_from_account = lambda acc: 'myjid@' + acc
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ gajim_root = os.path.join(os.path.abspath(os.path.dirname(__file__)), '../..')
|
|||
|
||||
# look for modules in the CWD, then gajim/test/lib, then gajim/gajim,
|
||||
# then everywhere else
|
||||
sys.path.insert(1, gajim_root + '/gajim')
|
||||
sys.path.insert(1, gajim_root)
|
||||
sys.path.insert(1, gajim_root + '/test/lib')
|
||||
|
||||
# a temporary version of ~/.gajim for testing
|
||||
|
@ -48,7 +48,7 @@ def setup_env():
|
|||
gajim.use_x = use_x
|
||||
|
||||
if use_x:
|
||||
import gtkgui_helpers
|
||||
from gajim import gtkgui_helpers
|
||||
gtkgui_helpers.GUI_DIR = gajim_root + '/data/gui'
|
||||
from gajim.gajim import GajimApplication
|
||||
gajim.app = GajimApplication()
|
||||
|
|
|
@ -3,10 +3,10 @@ Module with dummy classes for Gajim specific unit testing
|
|||
'''
|
||||
|
||||
from mock import Mock
|
||||
from common import gajim
|
||||
from common import ged
|
||||
from gajim.common import gajim
|
||||
from gajim.common import ged
|
||||
|
||||
from common.connection_handlers import ConnectionHandlers
|
||||
from gajim.common.connection_handlers import ConnectionHandlers
|
||||
|
||||
class MockConnection(Mock, ConnectionHandlers):
|
||||
def __init__(self, account, *args):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# mock notify module
|
||||
|
||||
from common import gajim
|
||||
from common import ged
|
||||
from gajim.common import gajim
|
||||
from gajim.common import ged
|
||||
|
||||
notifications = []
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import unittest
|
|||
import lib
|
||||
lib.setup_env()
|
||||
|
||||
from common.account import Account
|
||||
from gajim.common.account import Account
|
||||
|
||||
class Test(unittest.TestCase):
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@ import lib
|
|||
lib.setup_env()
|
||||
|
||||
from nbxmpp import NS_MUC, NS_PING, NS_XHTML_IM
|
||||
from common import caps_cache as caps
|
||||
from common.contacts import Contact
|
||||
from gajim.common import caps_cache as caps
|
||||
from gajim.common.contacts import Contact
|
||||
|
||||
from mock import Mock
|
||||
|
||||
|
|
|
@ -6,10 +6,10 @@ import unittest
|
|||
import lib
|
||||
lib.setup_env()
|
||||
|
||||
from common.contacts import CommonContact, Contact, GC_Contact, LegacyContactsAPI
|
||||
from gajim.common.contacts import CommonContact, Contact, GC_Contact, LegacyContactsAPI
|
||||
from nbxmpp import NS_MUC
|
||||
|
||||
from common import caps_cache
|
||||
from gajim.common import caps_cache
|
||||
|
||||
class TestCommonContact(unittest.TestCase):
|
||||
|
||||
|
|
|
@ -6,15 +6,15 @@ import unittest
|
|||
import lib
|
||||
lib.setup_env()
|
||||
|
||||
from common import logging_helpers
|
||||
from gajim.common import logging_helpers
|
||||
logging_helpers.set_quiet()
|
||||
|
||||
from common import gajim
|
||||
from gajim.common import gajim
|
||||
|
||||
from gajim_mocks import MockLogger
|
||||
gajim.logger = MockLogger()
|
||||
|
||||
from gui_interface import Interface
|
||||
from gajim.gui_interface import Interface
|
||||
|
||||
class TestInterface(unittest.TestCase):
|
||||
|
||||
|
|
|
@ -6,14 +6,14 @@ import unittest
|
|||
import lib
|
||||
lib.setup_env()
|
||||
|
||||
from common import gajim
|
||||
from common import nec
|
||||
from common import ged
|
||||
from common import caps_cache
|
||||
from common.connection_handlers import ConnectionHandlers
|
||||
from common.protocol import caps
|
||||
from common.contacts import Contact
|
||||
from common.connection_handlers_events import CapsPresenceReceivedEvent
|
||||
from gajim.common import gajim
|
||||
from gajim.common import nec
|
||||
from gajim.common import ged
|
||||
from gajim.common import caps_cache
|
||||
from gajim.common.connection_handlers import ConnectionHandlers
|
||||
from gajim.common.protocol import caps
|
||||
from gajim.common.contacts import Contact
|
||||
from gajim.common.connection_handlers_events import CapsPresenceReceivedEvent
|
||||
|
||||
from mock import Mock
|
||||
|
||||
|
|
|
@ -8,17 +8,17 @@ lib.setup_env()
|
|||
|
||||
import notify
|
||||
|
||||
from common import gajim
|
||||
from common import nec
|
||||
from common import ged
|
||||
from common.nec import NetworkEvent
|
||||
from common.connection_handlers_events import MessageReceivedEvent
|
||||
from common.connection_handlers_events import DecryptedMessageReceivedEvent
|
||||
from gajim.common import gajim
|
||||
from gajim.common import nec
|
||||
from gajim.common import ged
|
||||
from gajim.common.nec import NetworkEvent
|
||||
from gajim.common.connection_handlers_events import MessageReceivedEvent
|
||||
from gajim.common.connection_handlers_events import DecryptedMessageReceivedEvent
|
||||
import nbxmpp
|
||||
|
||||
from common.stanza_session import StanzaSession
|
||||
from session import ChatControlSession
|
||||
from roster_window import RosterWindow
|
||||
from gajim.common.stanza_session import StanzaSession
|
||||
from gajim.session import ChatControlSession
|
||||
from gajim.roster_window import RosterWindow
|
||||
|
||||
from mock import Mock, expectParams
|
||||
from gajim_mocks import *
|
||||
|
|
|
@ -10,8 +10,8 @@ from mock import Mock
|
|||
import sys
|
||||
import socket
|
||||
|
||||
from common.socks5 import *
|
||||
from common import jingle_xtls
|
||||
from gajim.common.socks5 import *
|
||||
from gajim.common import jingle_xtls
|
||||
|
||||
class fake_sock(Mock):
|
||||
def __init__(self, sockobj):
|
||||
|
|
Loading…
Reference in New Issue