Ejemplo n.º 1
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')
Ejemplo n.º 2
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)
Ejemplo n.º 3
0
 def setUp(self):
     self.MyVersionQuery = MyVersionQuery(parent=Iq(type_='get'))
     self.MyVersionQuery.host = hostEmul(client_name = 'name', 
                                         client_os = 'os',
                                         client_version = 'version')
Ejemplo n.º 4
0
 def setUp(self):
     self.query = disco.VDiscoInfoQuery(parent=Iq(type_='set'))
     self.query.host = hostEmul(static_items={'':disco.DiscoItemsQuery()},
                             static_info={'':disco.DiscoInfoQuery()})
Ejemplo n.º 5
0
 def setUp(self):
     self.MyVersionQuery = MyVersionQuery(parent=Iq(type_='get'))
     self.MyVersionQuery.host = hostEmul(client_name='name',
                                         client_os='os',
                                         client_version='version')
Ejemplo n.º 6
0
 def setUp(self):
     self.query = disco.VDiscoInfoQuery(parent=Iq(type_='set'))
     self.query.host = hostEmul(static_items={'': disco.DiscoItemsQuery()},
                                static_info={'': disco.DiscoInfoQuery()})