Mercurial > libervia-backend
diff src/test/helpers.py @ 1269:91e5becc6623
test: add tests for plugin_misc_groupblog
author | souliane <souliane@mailoo.org> |
---|---|
date | Mon, 15 Dec 2014 14:05:28 +0100 |
parents | 020e663bc286 |
children | 2308f8405ffb |
line wrap: on
line diff
--- a/src/test/helpers.py Mon Dec 15 14:04:19 2014 +0100 +++ b/src/test/helpers.py Mon Dec 15 14:05:28 2014 +0100 @@ -23,7 +23,7 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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()