def test_init(self): hand = [ (dispatcherEmul('jid'), '2'), ] self.CV.init(handlers=hand) hand.insert(0, (MyVersionQuery, self.CV)) self.assertEqual(self.CV.dispatcher._handlers, hand)
def test_clean_to(self): Validator = stanzas.MyValidator() disp = dispatcherEmul('myjid') Validator.host = hostEmul(dispatcher=disp) Validator.dispatcher = disp self.assertEqual(Validator.clean_to(JID('myjid')), disp.myjid) self.assertRaises(WrongElement, Validator.clean_to, 'some-jid')
def setUp(self): self.MyVCardQuery = MyVCardQuery(parent=Iq(type_='result', to='somejid')) disp = dispatcherEmul('somejid') self.vc = VCardQuery(name='John') host = hostEmul(myvcard=self.vc, dispatcher=disp) self.MyVCardQuery.host = host self.VCard = VCard(disp, self.vc)
def test_init(self): hand=[(dispatcherEmul('jid'), '2'),] self.disco.init(handlers=hand) test_list=[(disco.VDiscoInfoQuery, self.disco), (disco.VDiscoItemsQuery, self.disco), (disco.NotFoundDiscoInfoQuery, self.disco), (disco.NotFoundDiscoItemsQuery, self.disco)] test_list.insert(2, hand[0]) self.assertEqual(self.disco.dispatcher._handlers, test_list)
def test_init(self): hand = [ (dispatcherEmul('jid'), '2'), ] self.disco.init(handlers=hand) test_list = [(disco.VDiscoInfoQuery, self.disco), (disco.VDiscoItemsQuery, self.disco), (disco.NotFoundDiscoInfoQuery, self.disco), (disco.NotFoundDiscoItemsQuery, self.disco)] test_list.insert(2, hand[0]) self.assertEqual(self.disco.dispatcher._handlers, test_list)
def test_init(self): hand=[(dispatcherEmul('jid'), '2'),] self.CV.init(handlers=hand) hand.insert(0, (MyVersionQuery, self.CV)) self.assertEqual(self.CV.dispatcher._handlers, hand)
def setUp(self): self.CV = ClientVersion(dispatcher=dispatcherEmul('jid'))
def test_init(self): hand=[(dispatcherEmul('jid'), '2'),] self.VC.init(handlers=hand) hand.insert(0, (MyVCardQuery, self.VC)) self.assertEqual(self.VC.dispatcher._handlers, hand)
def setUp(self): self.VC = VCard(dispatcher=dispatcherEmul('jid'))
def setUp(self): self.disco = disco.Disco(dispatcherEmul('myjid')) self.to = 'somejid'
def setUp(self): self.rost = roster.Roster(dispatcherEmul('jid'), mypresence='pr')