Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test/lib
diff options
context:
space:
mode:
authorAndré Apitzsch <git@apitzsch.eu>2017-08-13 14:18:56 +0300
committerAndré Apitzsch <git@apitzsch.eu>2017-08-18 21:03:20 +0300
commit89c7eb6e6ab3f61a188c6cee063a000526df522c (patch)
tree773e22905e507b7244ce4f6390b27275c4cf9d83 /test/lib
parent56d002ce34b29e616c40f3005269ee4d157fc2c1 (diff)
Rename gajim.common.gajim to avoid name conflicts
Diffstat (limited to 'test/lib')
-rw-r--r--test/lib/__init__.py10
-rw-r--r--test/lib/gajim_mocks.py48
-rw-r--r--test/lib/notify.py6
3 files changed, 32 insertions, 32 deletions
diff --git a/test/lib/__init__.py b/test/lib/__init__.py
index 192b31844..9c10673c6 100644
--- a/test/lib/__init__.py
+++ b/test/lib/__init__.py
@@ -38,17 +38,17 @@ def setup_env():
import gajim.common.configpaths
gajim.common.configpaths.gajimpaths.init(configdir)
- # for some reason gajim.common.gajim needs to be imported before xmpppy?
- from gajim.common import gajim
+ # for some reason gajim.common.app needs to be imported before xmpppy?
+ from gajim.common import app
import logging
logging.basicConfig()
- gajim.DATA_DIR = gajim_root + '/data'
- gajim.use_x = use_x
+ app.DATA_DIR = gajim_root + '/data'
+ app.use_x = use_x
if use_x:
from gajim import gtkgui_helpers
gtkgui_helpers.GUI_DIR = gajim_root + '/data/gui'
from gajim.gajim import GajimApplication
- gajim.app = GajimApplication()
+ app.app = GajimApplication()
diff --git a/test/lib/gajim_mocks.py b/test/lib/gajim_mocks.py
index cea618347..dd528cfc7 100644
--- a/test/lib/gajim_mocks.py
+++ b/test/lib/gajim_mocks.py
@@ -3,7 +3,7 @@ Module with dummy classes for Gajim specific unit testing
'''
from mock import Mock
-from gajim.common import gajim
+from gajim.common import app
from gajim.common import ged
from gajim.common.connection_handlers import ConnectionHandlers
@@ -26,26 +26,26 @@ class MockConnection(Mock, ConnectionHandlers):
self.nested_group_delimiter = '::'
self.server_resource = 'Gajim'
- gajim.interface.instances[account] = {'infos': {}, 'disco': {},
+ app.interface.instances[account] = {'infos': {}, 'disco': {},
'gc_config': {}, 'search': {}, 'sub_request': {}}
- gajim.interface.minimized_controls[account] = {}
- gajim.contacts.add_account(account)
- gajim.groups[account] = {}
- gajim.gc_connected[account] = {}
- gajim.automatic_rooms[account] = {}
- gajim.newly_added[account] = []
- gajim.to_be_removed[account] = []
- gajim.nicks[account] = gajim.config.get_per('accounts', account, 'name')
- gajim.block_signed_in_notifications[account] = True
- gajim.sleeper_state[account] = 0
- gajim.encrypted_chats[account] = []
- gajim.last_message_time[account] = {}
- gajim.status_before_autoaway[account] = ''
- gajim.transport_avatar[account] = {}
- gajim.gajim_optional_features[account] = []
- gajim.caps_hash[account] = ''
-
- gajim.connections[account] = self
+ app.interface.minimized_controls[account] = {}
+ app.contacts.add_account(account)
+ app.groups[account] = {}
+ app.gc_connected[account] = {}
+ app.automatic_rooms[account] = {}
+ app.newly_added[account] = []
+ app.to_be_removed[account] = []
+ app.nicks[account] = app.config.get_per('accounts', account, 'name')
+ app.block_signed_in_notifications[account] = True
+ app.sleeper_state[account] = 0
+ app.encrypted_chats[account] = []
+ app.last_message_time[account] = {}
+ app.status_before_autoaway[account] = ''
+ app.transport_avatar[account] = {}
+ app.gajim_optional_features[account] = []
+ app.caps_hash[account] = ''
+
+ app.connections[account] = self
def request_vcard(self, jid):
pass
@@ -103,19 +103,19 @@ class MockChatControl(Mock):
class MockInterface(Mock):
def __init__(self, *args):
Mock.__init__(self, *args)
- gajim.interface = self
+ app.interface = self
self.msg_win_mgr = Mock()
self.roster = Mock()
- gajim.ged = ged.GlobalEventsDispatcher()
+ app.ged = ged.GlobalEventsDispatcher()
import plugins
- gajim.plugin_manager = plugins.PluginManager()
+ app.plugin_manager = plugins.PluginManager()
self.remote_ctrl = None
self.instances = {}
self.minimized_controls = {}
self.status_sent_to_users = Mock()
- if gajim.use_x:
+ if app.use_x:
self.jabber_state_images = {'16': {}, '24': {}, '32': {},
'opened': {}, 'closed': {}}
diff --git a/test/lib/notify.py b/test/lib/notify.py
index e903691c2..9bf59ea83 100644
--- a/test/lib/notify.py
+++ b/test/lib/notify.py
@@ -1,6 +1,6 @@
# mock notify module
-from gajim.common import gajim
+from gajim.common import app
from gajim.common import ged
notifications = []
@@ -13,11 +13,11 @@ class Notification:
def clean(self):
global notifications
notifications = []
- gajim.ged.remove_event_handler('notification', ged.GUI2,
+ app.ged.remove_event_handler('notification', ged.GUI2,
self._nec_notification)
def __init__(self):
- gajim.ged.register_event_handler('notification', ged.GUI2,
+ app.ged.register_event_handler('notification', ged.GUI2,
self._nec_notification)