core (tests): test fixes

This commit is contained in:
Goffi 2015-04-23 14:19:43 +02:00
commit 0ad78c5072
2 changed files with 15 additions and 9 deletions

View file

@ -151,15 +151,16 @@ class XEP_groupblogTest(helpers.SatTestCase):
if not self.__initialised:
client.item_access_pubsub = jid.JID(SERVICE)
xep_0060 = self.host.plugins['XEP-0060']
xep_0060.clients[profile] = helpers_plugins.FakeSatPubSubClient(self.host, xep_0060)
xep_0060.clients[profile].parent = client
self.psclient = xep_0060.clients[profile]
client.pubsub_client = helpers_plugins.FakeSatPubSubClient(self.host, xep_0060)
client.pubsub_client.parent = client
self.psclient = client.pubsub_client
helpers.FakeSAT.getDiscoItems = self.psclient.service_getDiscoItems
self.__initialised = True
return defer.succeed((profile, client))
def _addItem(self, profile, item, parent_node=None):
self.host.plugins['XEP-0060'].clients[profile]._addItem(item, parent_node)
client = self.host.getClient(profile)
client.pubsub_client._addItem(item, parent_node)
def test_sendGroupBlog(self):
self._initialise(C.PROFILE[0])

View file

@ -151,7 +151,7 @@ class XEP_0313Test(helpers.SatTestCase):
""" % (("H_%d" % domish.Element._idCounter), SERVICE)
start = datetime.datetime(2010, 8, 7, 0, 0, 0, tzinfo=tzutc())
form = buildForm(start=start)
rsm = RSMRequest(max=10)
rsm = RSMRequest(max_=10)
d = self.plugin.queryArchive(SERVICE_JID, form=form, rsm=rsm, profile_key=C.PROFILE[0])
d.addCallback(lambda dummy: self.assertEqualXML(self.host.getSentMessageXml(0), xml, True))
return d
@ -173,7 +173,7 @@ class XEP_0313Test(helpers.SatTestCase):
""" % (("H_%d" % domish.Element._idCounter), SERVICE)
start = datetime.datetime(2010, 8, 7, 0, 0, 0, tzinfo=tzutc())
form = buildForm(start=start)
rsm = RSMRequest(max=10, after=u'09af3-cc343-b409f')
rsm = RSMRequest(max_=10, after=u'09af3-cc343-b409f')
d = self.plugin.queryArchive(SERVICE_JID, form=form, rsm=rsm, profile_key=C.PROFILE[0])
d.addCallback(lambda dummy: self.assertEqualXML(self.host.getSentMessageXml(0), xml, True))
return d