diff 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
line wrap: on
line diff
--- a/idavoll/test/test_storage.py	Tue Jul 12 14:53:23 2005 +0000
+++ b/idavoll/test/test_storage.py	Thu Jul 14 20:51:48 2005 +0000
@@ -315,6 +315,19 @@
         d.addCallback(cb3)
         return d
 
+    def testGetNodeAffilatiations(self):
+        def cb1(node):
+            return node.get_affiliations()
+
+        def cb2(affiliations):
+            affiliations = dict(((a[0].full(), a[1]) for a in affiliations))
+            assertEquals(affiliations[OWNER.full()], 'owner')
+        
+        d = self.s.get_node('pre-existing')
+        d.addCallback(cb1)
+        d.addCallback(cb2)
+        return d
+
 class MemoryStorageStorageTestCase(unittest.TestCase, StorageTests):
 
     def setUpClass(self):