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