comparison idavoll/test/test_storage.py @ 145:f393bccec4bc

Add get_affiliations to Node class in storage facilities in preparation of support for 'Modifying Entity Affiliations' in the JEP-0060 specification.
author Ralph Meijer <ralphm@ik.nu>
date Thu, 14 Jul 2005 20:51:48 +0000
parents 812300cdbc22
children b4490bdc77e5
comparison
equal deleted inserted replaced
144:5b0b3f013ccc 145:f393bccec4bc
311 311
312 d = self.s.get_node('to-be-purged') 312 d = self.s.get_node('to-be-purged')
313 d.addCallback(cb1) 313 d.addCallback(cb1)
314 d.addCallback(cb2) 314 d.addCallback(cb2)
315 d.addCallback(cb3) 315 d.addCallback(cb3)
316 return d
317
318 def testGetNodeAffilatiations(self):
319 def cb1(node):
320 return node.get_affiliations()
321
322 def cb2(affiliations):
323 affiliations = dict(((a[0].full(), a[1]) for a in affiliations))
324 assertEquals(affiliations[OWNER.full()], 'owner')
325
326 d = self.s.get_node('pre-existing')
327 d.addCallback(cb1)
328 d.addCallback(cb2)
316 return d 329 return d
317 330
318 class MemoryStorageStorageTestCase(unittest.TestCase, StorageTests): 331 class MemoryStorageStorageTestCase(unittest.TestCase, StorageTests):
319 332
320 def setUpClass(self): 333 def setUpClass(self):