Beispiel #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')
Beispiel #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)
Beispiel #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')
Beispiel #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()})
Beispiel #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')
Beispiel #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()})