comparison idavoll/test/test_storage.py @ 226:b7018ec56ee5

Always use the bare JID for affilitations. Author: sir_sigurd, ralphm. Fixes: #20.
author Ralph Meijer <ralphm@ik.nu>
date Sun, 13 Feb 2011 21:46:33 +0100
parents 0eafdced5f24
children 8540825f85e0
comparison
equal deleted inserted replaced
225:c15c2fc058ed 226:b7018ec56ee5
11 from twisted.internet import defer 11 from twisted.internet import defer
12 from twisted.words.xish import domish 12 from twisted.words.xish import domish
13 13
14 from idavoll import error, iidavoll 14 from idavoll import error, iidavoll
15 15
16 OWNER = jid.JID('owner@example.com') 16 OWNER = jid.JID('owner@example.com/Work')
17 SUBSCRIBER = jid.JID('subscriber@example.com/Home') 17 SUBSCRIBER = jid.JID('subscriber@example.com/Home')
18 SUBSCRIBER_NEW = jid.JID('new@example.com/Home') 18 SUBSCRIBER_NEW = jid.JID('new@example.com/Home')
19 SUBSCRIBER_TO_BE_DELETED = jid.JID('to_be_deleted@example.com/Home') 19 SUBSCRIBER_TO_BE_DELETED = jid.JID('to_be_deleted@example.com/Home')
20 SUBSCRIBER_PENDING = jid.JID('pending@example.com/Home') 20 SUBSCRIBER_PENDING = jid.JID('pending@example.com/Home')
21 PUBLISHER = jid.JID('publisher@example.com') 21 PUBLISHER = jid.JID('publisher@example.com')
419 def cb1(node): 419 def cb1(node):
420 return node.getAffiliations() 420 return node.getAffiliations()
421 421
422 def cb2(affiliations): 422 def cb2(affiliations):
423 affiliations = dict(((a[0].full(), a[1]) for a in affiliations)) 423 affiliations = dict(((a[0].full(), a[1]) for a in affiliations))
424 self.assertEquals(affiliations[OWNER.full()], 'owner') 424 self.assertEquals(affiliations[OWNER.userhost()], 'owner')
425 425
426 d = self.s.getNode('pre-existing') 426 d = self.s.getNode('pre-existing')
427 d.addCallback(cb1) 427 d.addCallback(cb1)
428 d.addCallback(cb2) 428 d.addCallback(cb2)
429 return d 429 return d