Esempio n. 1
0
 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)
Esempio n. 2
0
 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')
Esempio n. 3
0
 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)
Esempio n. 4
0
 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)        
Esempio n. 5
0
 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)
Esempio n. 6
0
 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)
Esempio n. 7
0
 def setUp(self):
     self.CV = ClientVersion(dispatcher=dispatcherEmul('jid'))
Esempio n. 8
0
 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)
Esempio n. 9
0
 def setUp(self):
     self.VC = VCard(dispatcher=dispatcherEmul('jid'))
Esempio n. 10
0
 def setUp(self):
     self.disco = disco.Disco(dispatcherEmul('myjid'))
     self.to = 'somejid'
Esempio n. 11
0
 def setUp(self):
     self.rost = roster.Roster(dispatcherEmul('jid'), 
                               mypresence='pr')        
Esempio n. 12
0
 def setUp(self):
     self.rost = roster.Roster(dispatcherEmul('jid'), mypresence='pr')
Esempio n. 13
0
 def setUp(self):
     self.CV = ClientVersion(dispatcher=dispatcherEmul('jid'))
Esempio n. 14
0
 def setUp(self):
     self.disco = disco.Disco(dispatcherEmul('myjid'))
     self.to = 'somejid'