comparison sat_pubsub/test/test_backend.py @ 364:8bd8be6815ab

completed docstrings + use short notation for sets
author Arnaud Joset <info@agayon.be>
date Fri, 03 Nov 2017 13:59:54 +0100
parents 5d7c3787672e
children 9fbb31ce495b
comparison
equal deleted inserted replaced
363:a98b3d52c2ff 364:8bd8be6815ab
219 def cb(result): 219 def cb(result):
220 self.assertEquals(1, len(result)) 220 self.assertEquals(1, len(result))
221 subscriber, subscriptions, items = result[-1] 221 subscriber, subscriptions, items = result[-1]
222 222
223 self.assertEquals(OWNER, subscriber) 223 self.assertEquals(OWNER, subscriber)
224 self.assertEquals(set([sub]), subscriptions) 224 self.assertEquals({sub}, subscriptions)
225 self.assertEquals([item], items) 225 self.assertEquals([item], items)
226 226
227 self.storage = self.NodeStore({'test': TestNode()}) 227 self.storage = self.NodeStore({'test': TestNode()})
228 self.backend = backend.BackendService(self.storage) 228 self.backend = backend.BackendService(self.storage)
229 d = self.backend.getNotifications('test', [item]) 229 d = self.backend.getNotifications('test', [item])
252 252
253 def cb(result): 253 def cb(result):
254 self.assertEquals(1, len(result)) 254 self.assertEquals(1, len(result))
255 subscriber, subscriptions, items = result[-1] 255 subscriber, subscriptions, items = result[-1]
256 self.assertEquals(OWNER, subscriber) 256 self.assertEquals(OWNER, subscriber)
257 self.assertEquals(set([subRoot]), subscriptions) 257 self.assertEquals({subRoot}, subscriptions)
258 self.assertEquals([item], items) 258 self.assertEquals([item], items)
259 259
260 self.storage = self.NodeStore({'test': TestNode(), 260 self.storage = self.NodeStore({'test': TestNode(),
261 '': TestRootNode()}) 261 '': TestRootNode()})
262 self.backend = backend.BackendService(self.storage) 262 self.backend = backend.BackendService(self.storage)
285 def cb(result): 285 def cb(result):
286 self.assertEquals(1, len(result)) 286 self.assertEquals(1, len(result))
287 subscriber, subscriptions, items = result[-1] 287 subscriber, subscriptions, items = result[-1]
288 288
289 self.assertEquals(OWNER, subscriber) 289 self.assertEquals(OWNER, subscriber)
290 self.assertEquals(set([sub, subRoot]), subscriptions) 290 self.assertEquals({sub, subRoot}, subscriptions)
291 self.assertEquals([item], items) 291 self.assertEquals([item], items)
292 292
293 self.storage = self.NodeStore({'test': TestNode(), 293 self.storage = self.NodeStore({'test': TestNode(),
294 '': TestRootNode()}) 294 '': TestRootNode()})
295 self.backend = backend.BackendService(self.storage) 295 self.backend = backend.BackendService(self.storage)