Fix stanza accessors case in tests

They were using deprecated (and-removed) style.
This commit is contained in:
mathieui 2016-10-04 21:15:01 +02:00
parent f8cea760b6
commit 5da31db0c7
2 changed files with 21 additions and 21 deletions

View file

@ -142,7 +142,7 @@ class TestElementBase(SlixTest):
interfaces = set(('bar', 'baz', 'qux')) interfaces = set(('bar', 'baz', 'qux'))
sub_interfaces = set(('baz',)) sub_interfaces = set(('baz',))
def getQux(self): def get_qux(self):
return 'qux' return 'qux'
class TestStanzaPlugin(ElementBase): class TestStanzaPlugin(ElementBase):
@ -188,7 +188,7 @@ class TestElementBase(SlixTest):
interfaces = set(('bar', 'baz', 'qux')) interfaces = set(('bar', 'baz', 'qux'))
sub_interfaces = set(('baz',)) sub_interfaces = set(('baz',))
def setQux(self, value): def set_qux(self, value):
pass pass
class TestStanzaPlugin(ElementBase): class TestStanzaPlugin(ElementBase):
@ -222,7 +222,7 @@ class TestElementBase(SlixTest):
interfaces = set(('bar', 'baz', 'qux')) interfaces = set(('bar', 'baz', 'qux'))
sub_interfaces = set(('bar',)) sub_interfaces = set(('bar',))
def delQux(self): def del_qux(self):
pass pass
class TestStanzaPlugin(ElementBase): class TestStanzaPlugin(ElementBase):
@ -300,14 +300,14 @@ class TestElementBase(SlixTest):
namespace = "foo" namespace = "foo"
interfaces = set(('bar',)) interfaces = set(('bar',))
def setBar(self, value): def set_bar(self, value):
wrapper = ET.Element("{foo}wrapper") wrapper = ET.Element("{foo}wrapper")
bar = ET.Element("{foo}bar") bar = ET.Element("{foo}bar")
bar.text = value bar.text = value
wrapper.append(bar) wrapper.append(bar)
self.xml.append(wrapper) self.xml.append(wrapper)
def getBar(self): def get_bar(self):
return self._get_sub_text("wrapper/bar", default="not found") return self._get_sub_text("wrapper/bar", default="not found")
stanza = TestStanza() stanza = TestStanza()
@ -333,16 +333,16 @@ class TestElementBase(SlixTest):
namespace = "foo" namespace = "foo"
interfaces = set(('bar', 'baz')) interfaces = set(('bar', 'baz'))
def setBaz(self, value): def set_baz(self, value):
self._set_sub_text("wrapper/baz", text=value) self._set_sub_text("wrapper/baz", text=value)
def getBaz(self): def get_baz(self):
return self._get_sub_text("wrapper/baz") return self._get_sub_text("wrapper/baz")
def setBar(self, value): def set_bar(self, value):
self._set_sub_text("wrapper/bar", text=value) self._set_sub_text("wrapper/bar", text=value)
def getBar(self): def get_bar(self):
return self._get_sub_text("wrapper/bar") return self._get_sub_text("wrapper/bar")
stanza = TestStanza() stanza = TestStanza()
@ -384,22 +384,22 @@ class TestElementBase(SlixTest):
namespace = "foo" namespace = "foo"
interfaces = set(('bar', 'baz')) interfaces = set(('bar', 'baz'))
def setBar(self, value): def set_bar(self, value):
self._set_sub_text("path/to/only/bar", value) self._set_sub_text("path/to/only/bar", value)
def getBar(self): def get_bar(self):
return self._get_sub_text("path/to/only/bar") return self._get_sub_text("path/to/only/bar")
def delBar(self): def del_bar(self):
self._del_sub("path/to/only/bar") self._del_sub("path/to/only/bar")
def setBaz(self, value): def set_baz(self, value):
self._set_sub_text("path/to/just/baz", value) self._set_sub_text("path/to/just/baz", value)
def getBaz(self): def get_baz(self):
return self._get_sub_text("path/to/just/baz") return self._get_sub_text("path/to/just/baz")
def delBaz(self): def del_baz(self):
self._del_sub("path/to/just/baz") self._del_sub("path/to/just/baz")
stanza = TestStanza() stanza = TestStanza()
@ -466,10 +466,10 @@ class TestElementBase(SlixTest):
interfaces = set(('bar','baz', 'qux')) interfaces = set(('bar','baz', 'qux'))
sub_interfaces = set(('qux',)) sub_interfaces = set(('qux',))
def setQux(self, value): def set_qux(self, value):
self._set_sub_text('qux', text=value) self._set_sub_text('qux', text=value)
def getQux(self): def get_qux(self):
return self._get_sub_text('qux') return self._get_sub_text('qux')
class TestStanzaPlugin(ElementBase): class TestStanzaPlugin(ElementBase):

View file

@ -136,11 +136,11 @@ class TestPubsubStanzas(SlixTest):
iq = self.Iq() iq = self.Iq()
iq['pubsub_owner']['default'] iq['pubsub_owner']['default']
iq['pubsub_owner']['default']['node'] = 'mynode' iq['pubsub_owner']['default']['node'] = 'mynode'
iq['pubsub_owner']['default']['form'].addField('pubsub#title', iq['pubsub_owner']['default']['form'].add_field('pubsub#title',
ftype='text-single', ftype='text-single',
value='This thing is awesome') value='This thing is awesome')
self.check(iq, """ self.check(iq, """
<iq id="0"> <iq id="0">
<pubsub xmlns="http://jabber.org/protocol/pubsub#owner"> <pubsub xmlns="http://jabber.org/protocol/pubsub#owner">
<default node="mynode"> <default node="mynode">
<x xmlns="jabber:x:data" type="form"> <x xmlns="jabber:x:data" type="form">
@ -161,7 +161,7 @@ class TestPubsubStanzas(SlixTest):
iq['pubsub']['subscribe']['options']['node'] = 'cheese' iq['pubsub']['subscribe']['options']['node'] = 'cheese'
iq['pubsub']['subscribe']['options']['jid'] = 'fritzy@netflint.net/slixmpp' iq['pubsub']['subscribe']['options']['jid'] = 'fritzy@netflint.net/slixmpp'
form = xep_0004.Form() form = xep_0004.Form()
form.addField('pubsub#title', ftype='text-single', value='this thing is awesome') form.add_field('pubsub#title', ftype='text-single', value='this thing is awesome')
iq['pubsub']['subscribe']['options']['options'] = form iq['pubsub']['subscribe']['options']['options'] = form
self.check(iq, """ self.check(iq, """
<iq id="0"> <iq id="0">
@ -253,7 +253,7 @@ class TestPubsubStanzas(SlixTest):
pub = iq['pubsub'] pub = iq['pubsub']
pub['create']['node'] = 'testnode2' pub['create']['node'] = 'testnode2'
pub['configure']['form']['type'] = 'submit' pub['configure']['form']['type'] = 'submit'
pub['configure']['form'].setFields([ pub['configure']['form'].set_fields([
('FORM_TYPE', {'type': 'hidden', ('FORM_TYPE', {'type': 'hidden',
'value': 'http://jabber.org/protocol/pubsub#node_config'}), 'value': 'http://jabber.org/protocol/pubsub#node_config'}),
('pubsub#node_type', {'type': 'list-single', ('pubsub#node_type', {'type': 'list-single',