comparison src/test/test_plugin_misc_groupblog.py @ 1424:2d8fccec84e8

core (tests): test fixes
author Goffi <goffi@goffi.org>
date Thu, 23 Apr 2015 14:19:43 +0200
parents 069ad98b360d
children 7f8af1e69812
comparison
equal deleted inserted replaced
1423:882e5fabf68c 1424:2d8fccec84e8
149 profile = profile_key 149 profile = profile_key
150 client = self.host.getClient(profile) 150 client = self.host.getClient(profile)
151 if not self.__initialised: 151 if not self.__initialised:
152 client.item_access_pubsub = jid.JID(SERVICE) 152 client.item_access_pubsub = jid.JID(SERVICE)
153 xep_0060 = self.host.plugins['XEP-0060'] 153 xep_0060 = self.host.plugins['XEP-0060']
154 xep_0060.clients[profile] = helpers_plugins.FakeSatPubSubClient(self.host, xep_0060) 154 client.pubsub_client = helpers_plugins.FakeSatPubSubClient(self.host, xep_0060)
155 xep_0060.clients[profile].parent = client 155 client.pubsub_client.parent = client
156 self.psclient = xep_0060.clients[profile] 156 self.psclient = client.pubsub_client
157 helpers.FakeSAT.getDiscoItems = self.psclient.service_getDiscoItems 157 helpers.FakeSAT.getDiscoItems = self.psclient.service_getDiscoItems
158 self.__initialised = True 158 self.__initialised = True
159 return defer.succeed((profile, client)) 159 return defer.succeed((profile, client))
160 160
161 def _addItem(self, profile, item, parent_node=None): 161 def _addItem(self, profile, item, parent_node=None):
162 self.host.plugins['XEP-0060'].clients[profile]._addItem(item, parent_node) 162 client = self.host.getClient(profile)
163 client.pubsub_client._addItem(item, parent_node)
163 164
164 def test_sendGroupBlog(self): 165 def test_sendGroupBlog(self):
165 self._initialise(C.PROFILE[0]) 166 self._initialise(C.PROFILE[0])
166 d = self.psclient.items(SERVICE, NODE_ID) 167 d = self.psclient.items(SERVICE, NODE_ID)
167 d.addCallback(lambda items: self.assertEqual(len(items), 0)) 168 d.addCallback(lambda items: self.assertEqual(len(items), 0))