test: add tests for plugin_misc_groupblog
This commit is contained in:
parent
f3b7bd1ec2
commit
d262aff438
1 changed files with 535 additions and 28 deletions
|
|
@ -23,7 +23,7 @@ from sat.core import log_config
|
|||
log_config.satConfigure()
|
||||
|
||||
from sat.core import exceptions
|
||||
from constants import Const
|
||||
from constants import Const as C
|
||||
from wokkel.xmppim import RosterItem
|
||||
from sat.core.xmpp import SatRosterProtocol
|
||||
from sat.memory.memory import Params, Memory
|
||||
|
|
@ -123,7 +123,7 @@ class FakeSAT(object):
|
|||
def getJidNStream(self, profile_key):
|
||||
"""Convenient method to get jid and stream from profile key
|
||||
@return: tuple (jid, xmlstream) from profile, can be None"""
|
||||
return (Const.PROFILE_DICT[profile_key], None)
|
||||
return (C.PROFILE_DICT[profile_key], None)
|
||||
|
||||
def isConnected(self, profile):
|
||||
return True
|
||||
|
|
@ -134,7 +134,7 @@ class FakeSAT(object):
|
|||
been previously initialized with the method FakeSAT.getClient.
|
||||
@return: the sent message for given profile, or None"""
|
||||
try:
|
||||
return self.profiles[Const.PROFILE[profile_index]].xmlstream.sent.pop(0)
|
||||
return self.profiles[C.PROFILE[profile_index]].xmlstream.sent.pop(0)
|
||||
except IndexError:
|
||||
return None
|
||||
|
||||
|
|
@ -238,7 +238,7 @@ class FakeParams(Params):
|
|||
|
||||
def getProfileName(self, profile_key, return_profile_keys=False):
|
||||
if profile_key == '@DEFAULT@':
|
||||
return Const.PROFILE[0]
|
||||
return C.PROFILE[0]
|
||||
elif profile_key == '@NONE@':
|
||||
raise exceptions.ProfileNotSetError
|
||||
else:
|
||||
|
|
@ -345,8 +345,8 @@ class FakeClient(object):
|
|||
|
||||
def __init__(self, host, profile=None):
|
||||
self.host = host
|
||||
self.profile = profile if profile else Const.PROFILE[0]
|
||||
self.jid = Const.PROFILE_DICT[self.profile]
|
||||
self.profile = profile if profile else C.PROFILE[0]
|
||||
self.jid = C.PROFILE_DICT[self.profile]
|
||||
self.roster = FakeRosterProtocol(host, self)
|
||||
self.xmlstream = FakeXmlStream()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue