sed -i 's/set((\(.*\)))$/{\1}/g' **/*.py

This commit is contained in:
Emmanuel Gil Peyrot 2016-10-22 13:20:27 +01:00
parent 1038f656eb
commit c4285961df
38 changed files with 100 additions and 100 deletions

View file

@ -41,7 +41,7 @@ class Action(ElementBase):
#: del action['status']
#:
#: to set, get, or remove its values.
interfaces = set(('method', 'param', 'status'))
interfaces = {'method', 'param', 'status'}
#: By default, values in the `interfaces` set are mapped to
#: attribute values. This can be changed such that an interface

View file

@ -16,6 +16,6 @@ class Bind(ElementBase):
name = 'bind'
namespace = 'urn:ietf:params:xml:ns:xmpp-bind'
interfaces = set(('resource', 'jid'))
interfaces = {'resource', 'jid'}
sub_interfaces = interfaces
plugin_attrib = 'bind'

View file

@ -19,7 +19,7 @@ class Auth(StanzaBase):
name = 'auth'
namespace = 'urn:ietf:params:xml:ns:xmpp-sasl'
interfaces = set(('mechanism', 'value'))
interfaces = {'mechanism', 'value'}
plugin_attrib = name
#: Some SASL mechs require sending values as is,

View file

@ -16,7 +16,7 @@ class Failure(StanzaBase):
name = 'failure'
namespace = 'urn:ietf:params:xml:ns:xmpp-sasl'
interfaces = set(('condition', 'text'))
interfaces = {'condition', 'text'}
plugin_attrib = name
sub_interfaces = {'text'}
conditions = set(('aborted', 'account-disabled', 'credentials-expired',

View file

@ -16,7 +16,7 @@ class Mechanisms(ElementBase):
name = 'mechanisms'
namespace = 'urn:ietf:params:xml:ns:xmpp-sasl'
interfaces = set(('mechanisms', 'required'))
interfaces = {'mechanisms', 'required'}
plugin_attrib = name
is_extension = True

View file

@ -21,7 +21,7 @@ class GmailQuery(ElementBase):
namespace = 'google:mail:notify'
name = 'query'
plugin_attrib = 'gmail'
interfaces = set(('newer-than-time', 'newer-than-tid', 'q', 'search'))
interfaces = {'newer-than-time', 'newer-than-tid', 'q', 'search'}
def get_search(self):
return self['q']
@ -60,7 +60,7 @@ class MailThread(ElementBase):
plugin_attrib = 'thread'
interfaces = set(('tid', 'participation', 'messages', 'date',
'senders', 'url', 'labels', 'subject', 'snippet'))
sub_interfaces = set(('labels', 'subject', 'snippet'))
sub_interfaces = {'labels', 'subject', 'snippet'}
def get_senders(self):
senders = []
@ -75,7 +75,7 @@ class MailSender(ElementBase):
namespace = 'google:mail:notify'
name = 'sender'
plugin_attrib = 'sender'
interfaces = set(('address', 'name', 'originator', 'unread'))
interfaces = {'address', 'name', 'originator', 'unread'}
def get_originator(self):
return self.xml.attrib.get('originator', '0') == '1'

View file

@ -24,9 +24,9 @@ class FormField(ElementBase):
'jid-single', 'list-multi', 'list-single',
'text-multi', 'text-private', 'text-single'))
true_values = set((True, '1', 'true'))
option_types = set(('list-multi', 'list-single'))
multi_line_types = set(('hidden', 'text-multi'))
true_values = {True, '1', 'true'}
option_types = {'list-multi', 'list-single'}
multi_line_types = {'hidden', 'text-multi'}
multi_value_types = set(('hidden', 'jid-multi',
'list-multi', 'text-multi'))
@ -164,7 +164,7 @@ class FieldOption(ElementBase):
namespace = 'jabber:x:data'
name = 'option'
plugin_attrib = 'option'
interfaces = set(('label', 'value'))
interfaces = {'label', 'value'}
sub_interfaces = {'value'}
plugin_multi_attrib = 'options'

View file

@ -25,7 +25,7 @@ class Form(ElementBase):
plugin_attrib = 'form'
interfaces = OrderedSet(('instructions', 'reported', 'title', 'type', 'items', ))
sub_interfaces = {'title'}
form_types = set(('cancel', 'form', 'result', 'submit'))
form_types = {'cancel', 'form', 'result', 'submit'}
def __init__(self, *args, **kwargs):
title = None

View file

@ -14,8 +14,8 @@ class RPCQuery(ElementBase):
name = 'query'
namespace = 'jabber:iq:rpc'
plugin_attrib = 'rpc_query'
interfaces = set(())
subinterfaces = set(())
interfaces = {}
subinterfaces = {}
plugin_attrib_map = {}
plugin_tag_map = {}
@ -24,8 +24,8 @@ class MethodCall(ElementBase):
name = 'methodCall'
namespace = 'jabber:iq:rpc'
plugin_attrib = 'method_call'
interfaces = set(('method_name', 'params'))
subinterfaces = set(())
interfaces = {'method_name', 'params'}
subinterfaces = {}
plugin_attrib_map = {}
plugin_tag_map = {}
@ -46,8 +46,8 @@ class MethodResponse(ElementBase):
name = 'methodResponse'
namespace = 'jabber:iq:rpc'
plugin_attrib = 'method_response'
interfaces = set(('params', 'fault'))
subinterfaces = set(())
interfaces = {'params', 'fault'}
subinterfaces = {}
plugin_attrib_map = {}
plugin_tag_map = {}

View file

@ -14,7 +14,7 @@ class LastActivity(ElementBase):
name = 'query'
namespace = 'jabber:iq:last'
plugin_attrib = 'last_activity'
interfaces = set(('seconds', 'status'))
interfaces = {'seconds', 'status'}
def get_seconds(self):
return int(self._get_attr('seconds'))

View file

@ -71,7 +71,7 @@ class DiscoInfo(ElementBase):
name = 'query'
namespace = 'http://jabber.org/protocol/disco#info'
plugin_attrib = 'disco_info'
interfaces = set(('node', 'features', 'identities'))
interfaces = {'node', 'features', 'identities'}
lang_interfaces = {'identities'}
# Cache identities and features

View file

@ -45,7 +45,7 @@ class DiscoItems(ElementBase):
name = 'query'
namespace = 'http://jabber.org/protocol/disco#items'
plugin_attrib = 'disco_items'
interfaces = set(('node', 'items'))
interfaces = {'node', 'items'}
# Cache items
_items = set()
@ -138,7 +138,7 @@ class DiscoItem(ElementBase):
name = 'item'
namespace = 'http://jabber.org/protocol/disco#items'
plugin_attrib = name
interfaces = set(('jid', 'node', 'name'))
interfaces = {'jid', 'node', 'name'}
def get_node(self):
"""Return the item's node name or ``None``."""

View file

@ -39,7 +39,7 @@ class Address(ElementBase):
plugin_attrib = 'address'
interfaces = set(['type', 'jid', 'node', 'uri', 'desc', 'delivered'])
address_types = set(('bcc', 'cc', 'noreply', 'replyroom', 'replyto', 'to'))
address_types = {'bcc', 'cc', 'noreply', 'replyroom', 'replyto', 'to'}
def get_jid(self):
return JID(self._get_attr('jid'))

View file

@ -25,9 +25,9 @@ class MUCPresence(ElementBase):
name = 'x'
namespace = 'http://jabber.org/protocol/muc#user'
plugin_attrib = 'muc'
interfaces = set(('affiliation', 'role', 'jid', 'nick', 'room'))
affiliations = set(('', ))
roles = set(('', ))
interfaces = {'affiliation', 'role', 'jid', 'nick', 'room'}
affiliations = {'', }
roles = {'', }
def get_xml_item(self):
item = self.xml.find('{http://jabber.org/protocol/muc#user}item')

View file

@ -21,7 +21,7 @@ class Open(ElementBase):
name = 'open'
namespace = 'http://jabber.org/protocol/ibb'
plugin_attrib = 'ibb_open'
interfaces = set(('block_size', 'sid', 'stanza'))
interfaces = {'block_size', 'sid', 'stanza'}
def get_block_size(self):
return int(self._get_attr('block-size', '0'))
@ -37,7 +37,7 @@ class Data(ElementBase):
name = 'data'
namespace = 'http://jabber.org/protocol/ibb'
plugin_attrib = 'ibb_data'
interfaces = set(('seq', 'sid', 'data'))
interfaces = {'seq', 'sid', 'data'}
sub_interfaces = set(['data'])
def get_seq(self):

View file

@ -74,9 +74,9 @@ class Command(ElementBase):
plugin_attrib = 'command'
interfaces = set(('action', 'sessionid', 'node',
'status', 'actions', 'notes'))
actions = set(('cancel', 'complete', 'execute', 'next', 'prev'))
statuses = set(('canceled', 'completed', 'executing'))
next_actions = set(('prev', 'next', 'complete'))
actions = {'cancel', 'complete', 'execute', 'next', 'prev'}
statuses = {'canceled', 'completed', 'executing'}
next_actions = {'prev', 'next', 'complete'}
def get_action(self):
"""

View file

@ -30,7 +30,7 @@ class Affiliation(ElementBase):
namespace = 'http://jabber.org/protocol/pubsub'
name = 'affiliation'
plugin_attrib = name
interfaces = set(('node', 'affiliation', 'jid'))
interfaces = {'node', 'affiliation', 'jid'}
def set_jid(self, value):
self._set_attr('jid', str(value))
@ -43,7 +43,7 @@ class Subscription(ElementBase):
namespace = 'http://jabber.org/protocol/pubsub'
name = 'subscription'
plugin_attrib = name
interfaces = set(('jid', 'node', 'subscription', 'subid'))
interfaces = {'jid', 'node', 'subscription', 'subid'}
def set_jid(self, value):
self._set_attr('jid', str(value))
@ -70,7 +70,7 @@ class Item(ElementBase):
namespace = 'http://jabber.org/protocol/pubsub'
name = 'item'
plugin_attrib = name
interfaces = set(('id', 'payload'))
interfaces = {'id', 'payload'}
def set_payload(self, value):
del self['payload']
@ -95,7 +95,7 @@ class Items(ElementBase):
namespace = 'http://jabber.org/protocol/pubsub'
name = 'items'
plugin_attrib = name
interfaces = set(('node', 'max_items'))
interfaces = {'node', 'max_items'}
def set_max_items(self, value):
self._set_attr('max_items', str(value))
@ -112,7 +112,7 @@ class Default(ElementBase):
namespace = 'http://jabber.org/protocol/pubsub'
name = 'default'
plugin_attrib = name
interfaces = set(('node', 'type'))
interfaces = {'node', 'type'}
def get_type(self):
t = self._get_attr('type')
@ -132,7 +132,7 @@ class Retract(ElementBase):
namespace = 'http://jabber.org/protocol/pubsub'
name = 'retract'
plugin_attrib = name
interfaces = set(('node', 'notify'))
interfaces = {'node', 'notify'}
def get_notify(self):
notify = self._get_attr('notify')
@ -156,7 +156,7 @@ class Unsubscribe(ElementBase):
namespace = 'http://jabber.org/protocol/pubsub'
name = 'unsubscribe'
plugin_attrib = name
interfaces = set(('node', 'jid', 'subid'))
interfaces = {'node', 'jid', 'subid'}
def set_jid(self, value):
self._set_attr('jid', str(value))
@ -169,7 +169,7 @@ class Subscribe(ElementBase):
namespace = 'http://jabber.org/protocol/pubsub'
name = 'subscribe'
plugin_attrib = name
interfaces = set(('node', 'jid'))
interfaces = {'node', 'jid'}
def set_jid(self, value):
self._set_attr('jid', str(value))
@ -182,7 +182,7 @@ class Configure(ElementBase):
namespace = 'http://jabber.org/protocol/pubsub'
name = 'configure'
plugin_attrib = name
interfaces = set(('node', 'type'))
interfaces = {'node', 'type'}
def getType(self):
t = self._get_attr('type')
@ -195,7 +195,7 @@ class Options(ElementBase):
namespace = 'http://jabber.org/protocol/pubsub'
name = 'options'
plugin_attrib = name
interfaces = set(('jid', 'node', 'options'))
interfaces = {'jid', 'node', 'options'}
def __init__(self, *args, **kwargs):
ElementBase.__init__(self, *args, **kwargs)

View file

@ -13,7 +13,7 @@ from slixmpp.xmlstream import ElementBase, ET, register_stanza_plugin
class PubsubErrorCondition(ElementBase):
plugin_attrib = 'pubsub'
interfaces = set(('condition', 'unsupported'))
interfaces = {'condition', 'unsupported'}
plugin_attrib_map = {}
plugin_tag_map = {}
conditions = set(('closed-node', 'configuration-required', 'invalid-jid',

View file

@ -25,7 +25,7 @@ class EventItem(ElementBase):
namespace = 'http://jabber.org/protocol/pubsub#event'
name = 'item'
plugin_attrib = name
interfaces = set(('id', 'payload', 'node', 'publisher'))
interfaces = {'id', 'payload', 'node', 'publisher'}
def set_payload(self, value):
self.xml.append(value)
@ -93,7 +93,7 @@ class EventDelete(ElementBase):
namespace = 'http://jabber.org/protocol/pubsub#event'
name = 'delete'
plugin_attrib = name
interfaces = set(('node', 'redirect'))
interfaces = {'node', 'redirect'}
def set_redirect(self, uri):
del self['redirect']
@ -117,7 +117,7 @@ class EventSubscription(ElementBase):
namespace = 'http://jabber.org/protocol/pubsub#event'
name = 'subscription'
plugin_attrib = name
interfaces = set(('node', 'expiry', 'jid', 'subid', 'subscription'))
interfaces = {'node', 'expiry', 'jid', 'subid', 'subscription'}
def get_expiry(self):
expiry = self._get_attr('expiry')

View file

@ -25,7 +25,7 @@ class DefaultConfig(ElementBase):
namespace = 'http://jabber.org/protocol/pubsub#owner'
name = 'default'
plugin_attrib = name
interfaces = set(('node', 'config'))
interfaces = {'node', 'config'}
def __init__(self, *args, **kwargs):
ElementBase.__init__(self, *args, **kwargs)
@ -51,7 +51,7 @@ class OwnerAffiliations(Affiliations):
class OwnerAffiliation(Affiliation):
namespace = 'http://jabber.org/protocol/pubsub#owner'
interfaces = set(('affiliation', 'jid'))
interfaces = {'affiliation', 'jid'}
class OwnerConfigure(Configure):
@ -84,7 +84,7 @@ class OwnerRedirect(ElementBase):
namespace = 'http://jabber.org/protocol/pubsub#owner'
name = 'redirect'
plugin_attrib = name
interfaces = set(('node', 'jid'))
interfaces = {'node', 'jid'}
def set_jid(self, value):
self._set_attr('jid', str(value))
@ -109,7 +109,7 @@ class OwnerSubscription(ElementBase):
namespace = 'http://jabber.org/protocol/pubsub#owner'
name = 'subscription'
plugin_attrib = name
interfaces = set(('jid', 'subscription'))
interfaces = {'jid', 'subscription'}
def set_jid(self, value):
self._set_attr('jid', str(value))

View file

@ -17,8 +17,8 @@ class OOBTransfer(ElementBase):
name = 'query'
namespace = 'jabber:iq:oob'
plugin_attrib = 'oob_transfer'
interfaces = set(('url', 'desc', 'sid'))
sub_interfaces = set(('url', 'desc'))
interfaces = {'url', 'desc', 'sid'}
sub_interfaces = {'url', 'desc'}
class OOB(ElementBase):
@ -29,5 +29,5 @@ class OOB(ElementBase):
name = 'x'
namespace = 'jabber:x:oob'
plugin_attrib = 'oob'
interfaces = set(('url', 'desc'))
interfaces = {'url', 'desc'}
sub_interfaces = interfaces

View file

@ -13,8 +13,8 @@ class IqAuth(ElementBase):
namespace = 'jabber:iq:auth'
name = 'query'
plugin_attrib = 'auth'
interfaces = set(('fields', 'username', 'password', 'resource', 'digest'))
sub_interfaces = set(('username', 'password', 'resource', 'digest'))
interfaces = {'fields', 'username', 'password', 'resource', 'digest'}
sub_interfaces = {'username', 'password', 'resource', 'digest'}
plugin_tag_map = {}
plugin_attrib_map = {}

View file

@ -41,7 +41,7 @@ class ChatState(ElementBase):
sub_interfaces = interfaces
is_extension = True
states = set(('active', 'composing', 'gone', 'inactive', 'paused'))
states = {'active', 'composing', 'gone', 'inactive', 'paused'}
def setup(self, xml=None):
self.xml = ET.Element('')

View file

@ -18,7 +18,7 @@ class LegacyDelay(ElementBase):
name = 'x'
namespace = 'jabber:x:delay'
plugin_attrib = 'legacy_delay'
interfaces = set(('from', 'stamp', 'text'))
interfaces = {'from', 'stamp', 'text'}
def get_from(self):
from_ = self._get_attr('from')

View file

@ -38,5 +38,5 @@ class Version(ElementBase):
name = 'query'
namespace = 'jabber:iq:version'
plugin_attrib = 'software_version'
interfaces = set(('name', 'version', 'os'))
interfaces = {'name', 'version', 'os'}
sub_interfaces = interfaces

View file

@ -16,4 +16,4 @@ class Capabilities(ElementBase):
namespace = 'http://jabber.org/protocol/caps'
name = 'c'
plugin_attrib = 'caps'
interfaces = set(('hash', 'node', 'ver', 'ext'))
interfaces = {'hash', 'node', 'ver', 'ext'}

View file

@ -48,7 +48,7 @@ class EntityTime(ElementBase):
name = 'time'
namespace = 'urn:xmpp:time'
plugin_attrib = 'entity_time'
interfaces = set(('tzo', 'utc', 'time'))
interfaces = {'tzo', 'utc', 'time'}
sub_interfaces = interfaces
def set_time(self, value):

View file

@ -18,7 +18,7 @@ class Delay(ElementBase):
name = 'delay'
namespace = 'urn:xmpp:delay'
plugin_attrib = 'delay'
interfaces = set(('from', 'stamp', 'text'))
interfaces = {'from', 'stamp', 'text'}
def get_from(self):
from_ = self._get_attr('from')

View file

@ -18,7 +18,7 @@ class BitsOfBinary(ElementBase):
name = 'data'
namespace = 'urn:xmpp:bob'
plugin_attrib = 'bob'
interfaces = set(('cid', 'max_age', 'type', 'data'))
interfaces = {'cid', 'max_age', 'type', 'data'}
def get_max_age(self):
return int(self._get_attr('max-age'))

View file

@ -21,7 +21,7 @@ class AtomEntry(ElementBase):
namespace = 'http://www.w3.org/2005/Atom'
name = 'entry'
plugin_attrib = 'entry'
interfaces = set(('title', 'summary', 'id', 'published', 'updated'))
interfaces = {'title', 'summary', 'id', 'published', 'updated'}
sub_interfaces = set(('title', 'summary', 'id', 'published',
'updated'))
@ -37,7 +37,7 @@ class AtomAuthor(ElementBase):
name = 'author'
plugin_attrib = 'author'
interfaces = set(('name', 'uri'))
sub_interfaces = set(('name', 'uri'))
interfaces = {'name', 'uri'}
sub_interfaces = {'name', 'uri'}
register_stanza_plugin(AtomEntry, AtomAuthor)

View file

@ -66,7 +66,7 @@ class Error(ElementBase):
'service-unavailable', 'subscription-required',
'undefined-condition', 'unexpected-request'))
condition_ns = 'urn:ietf:params:xml:ns:xmpp-stanzas'
types = set(('cancel', 'continue', 'modify', 'auth', 'wait'))
types = {'cancel', 'continue', 'modify', 'auth', 'wait'}
def setup(self, xml=None):
"""

View file

@ -57,8 +57,8 @@ class Iq(RootStanza):
namespace = 'jabber:client'
name = 'iq'
interfaces = set(('type', 'to', 'from', 'id', 'query'))
types = set(('get', 'result', 'set', 'error'))
interfaces = {'type', 'to', 'from', 'id', 'query'}
types = {'get', 'result', 'set', 'error'}
plugin_attrib = name
def __init__(self, *args, **kwargs):

View file

@ -36,7 +36,7 @@ class Roster(ElementBase):
namespace = 'jabber:iq:roster'
name = 'query'
plugin_attrib = 'roster'
interfaces = set(('items', 'ver'))
interfaces = {'items', 'ver'}
def get_ver(self):
"""

View file

@ -54,7 +54,7 @@ class StreamError(Error, StanzaBase):
"""
namespace = 'http://etherx.jabber.org/streams'
interfaces = set(('condition', 'text', 'see_other_host'))
interfaces = {'condition', 'text', 'see_other_host'}
conditions = set((
'bad-format', 'bad-namespace-prefix', 'conflict',
'connection-timeout', 'host-gone', 'host-unknown',

View file

@ -17,7 +17,7 @@ class StreamFeatures(StanzaBase):
name = 'features'
namespace = 'http://etherx.jabber.org/streams'
interfaces = set(('features', 'required', 'optional'))
interfaces = {'features', 'required', 'optional'}
sub_interfaces = interfaces
plugin_tag_map = {}
plugin_attrib_map = {}

View file

@ -212,7 +212,7 @@ class ElementBase(object):
>>> class Message(ElementBase):
... name = "message"
... namespace = "jabber:client"
... interfaces = set(('to', 'from', 'type', 'body'))
... interfaces = {'to', 'from', 'type', 'body'}
... sub_interfaces = {'body'}
The resulting Message stanza's contents may be accessed as so::
@ -239,7 +239,7 @@ class ElementBase(object):
>>> class MessagePlugin(ElementBase):
... name = "custom_plugin"
... namespace = "custom"
... interfaces = set(('useful_thing', 'custom'))
... interfaces = {'useful_thing', 'custom'}
... plugin_attrib = "custom"
The plugin stanza class must be associated with its intended
@ -311,7 +311,7 @@ class ElementBase(object):
#: manipulating the underlying XML object. This set may be augmented
#: with the :attr:`plugin_attrib` value of any registered
#: stanza plugins.
interfaces = set(('type', 'to', 'from', 'id', 'payload'))
interfaces = {'type', 'to', 'from', 'id', 'payload'}
#: A subset of :attr:`interfaces` which maps interfaces to direct
#: subelements of the underlying XML object. Using this set, the text
@ -1385,10 +1385,10 @@ class StanzaBase(ElementBase):
#: There is a small set of attributes which apply to all XMPP stanzas:
#: the stanza type, the to and from JIDs, the stanza ID, and, especially
#: in the case of an Iq stanza, a payload.
interfaces = set(('type', 'to', 'from', 'id', 'payload'))
interfaces = {'type', 'to', 'from', 'id', 'payload'}
#: A basic set of allowed values for the ``'type'`` interface.
types = set(('get', 'set', 'error', None, 'unavailable', 'normal', 'chat'))
types = {'get', 'set', 'error', None, 'unavailable', 'normal', 'chat'}
def __init__(self, stream=None, xml=None, stype=None,
sto=None, sfrom=None, sid=None, parent=None):

View file

@ -43,18 +43,18 @@ class TestElementBase(SlixTest):
class TestStanzaPlugin(ElementBase):
name = "foo2"
namespace = "foo"
interfaces = set(('bar', 'baz'))
interfaces = {'bar', 'baz'}
plugin_attrib = "foo2"
class TestSubStanza(ElementBase):
name = "subfoo"
namespace = "foo"
interfaces = set(('bar', 'baz'))
interfaces = {'bar', 'baz'}
class TestStanza(ElementBase):
name = "foo"
namespace = "foo"
interfaces = set(('bar', 'baz'))
interfaces = {'bar', 'baz'}
register_stanza_plugin(TestStanza, TestStanzaPlugin, iterable=True)
@ -90,24 +90,24 @@ class TestElementBase(SlixTest):
class TestStanzaPlugin(ElementBase):
name = "pluginfoo"
namespace = "foo"
interfaces = set(('bar', 'baz'))
interfaces = {'bar', 'baz'}
plugin_attrib = "plugin_foo"
class TestStanzaPlugin2(ElementBase):
name = "pluginfoo2"
namespace = "foo"
interfaces = set(('bar', 'baz'))
interfaces = {'bar', 'baz'}
plugin_attrib = "plugin_foo2"
class TestSubStanza(ElementBase):
name = "subfoo"
namespace = "foo"
interfaces = set(('bar', 'baz'))
interfaces = {'bar', 'baz'}
class TestStanza(ElementBase):
name = "foo"
namespace = "foo"
interfaces = set(('bar', 'baz'))
interfaces = {'bar', 'baz'}
register_stanza_plugin(TestStanza, TestSubStanza, iterable=True)
register_stanza_plugin(TestStanza, TestStanzaPlugin)
@ -139,7 +139,7 @@ class TestElementBase(SlixTest):
class TestStanza(ElementBase):
name = "foo"
namespace = "foo"
interfaces = set(('bar', 'baz', 'qux'))
interfaces = {'bar', 'baz', 'qux'}
sub_interfaces = {'baz'}
def get_qux(self):
@ -185,7 +185,7 @@ class TestElementBase(SlixTest):
class TestStanza(ElementBase):
name = "foo"
namespace = "foo"
interfaces = set(('bar', 'baz', 'qux'))
interfaces = {'bar', 'baz', 'qux'}
sub_interfaces = {'baz'}
def set_qux(self, value):
@ -219,7 +219,7 @@ class TestElementBase(SlixTest):
class TestStanza(ElementBase):
name = "foo"
namespace = "foo"
interfaces = set(('bar', 'baz', 'qux'))
interfaces = {'bar', 'baz', 'qux'}
sub_interfaces = {'bar'}
def del_qux(self):
@ -261,7 +261,7 @@ class TestElementBase(SlixTest):
class TestStanza(ElementBase):
name = "foo"
namespace = "foo"
interfaces = set(('bar', 'baz'))
interfaces = {'bar', 'baz'}
stanza = TestStanza()
@ -331,7 +331,7 @@ class TestElementBase(SlixTest):
class TestStanza(ElementBase):
name = "foo"
namespace = "foo"
interfaces = set(('bar', 'baz'))
interfaces = {'bar', 'baz'}
def set_baz(self, value):
self._set_sub_text("wrapper/baz", text=value)
@ -382,7 +382,7 @@ class TestElementBase(SlixTest):
class TestStanza(ElementBase):
name = "foo"
namespace = "foo"
interfaces = set(('bar', 'baz'))
interfaces = {'bar', 'baz'}
def set_bar(self, value):
self._set_sub_text("path/to/only/bar", value)
@ -463,7 +463,7 @@ class TestElementBase(SlixTest):
class TestStanza(ElementBase):
name = "foo"
namespace = "foo"
interfaces = set(('bar','baz', 'qux'))
interfaces = {'bar','baz', 'qux'}
sub_interfaces = {'qux'}
def set_qux(self, value):
@ -528,7 +528,7 @@ class TestElementBase(SlixTest):
class TestStanza(ElementBase):
name = "foo"
namespace = "foo"
interfaces = set(('bar', 'baz'))
interfaces = {'bar', 'baz'}
stanza1 = TestStanza()
stanza1['bar'] = 'a'
@ -554,7 +554,7 @@ class TestElementBase(SlixTest):
class TestStanza(ElementBase):
name = "foo"
namespace = "foo"
interfaces = set(('bar', 'baz'))
interfaces = {'bar', 'baz'}
plugin_attrib = 'qux'
register_stanza_plugin(TestStanza, TestStanza)
@ -575,7 +575,7 @@ class TestElementBase(SlixTest):
class TestStanza(ElementBase):
name = "foo"
namespace = "foo"
interfaces = set(('bar', 'baz'))
interfaces = {'bar', 'baz'}
stanza = TestStanza()
stanza['bar'] = 'a'
@ -597,7 +597,7 @@ class TestElementBase(SlixTest):
class TestStanza(ElementBase):
name = "foo"
namespace = "foo"
interfaces = set(('bar', 'baz'))
interfaces = {'bar', 'baz'}
register_stanza_plugin(TestStanza, TestSubStanza, iterable=True)
@ -652,7 +652,7 @@ class TestElementBase(SlixTest):
class TestStanza(ElementBase):
name = "foo"
namespace = "foo"
interfaces = set(('bar', 'baz'))
interfaces = {'bar', 'baz'}
stanza1 = TestStanza()
stanza1['bar'] = 'a'
@ -672,7 +672,7 @@ class TestElementBase(SlixTest):
class TestStanza(ElementBase):
name = "foo"
namespace = "foo"
interfaces = set(('bar', 'baz'))
interfaces = {'bar', 'baz'}
class TestExtension(ElementBase):
name = 'extended'
@ -715,7 +715,7 @@ class TestElementBase(SlixTest):
class TestStanza(ElementBase):
name = "foo"
namespace = "foo"
interfaces = set(('bar', 'baz'))
interfaces = {'bar', 'baz'}
class TestOverride(ElementBase):
name = 'overrider'

View file

@ -102,7 +102,7 @@ class TestStreamPresence(SlixTest):
to="tester@localhost" />
""")
expected = set(('presence_available', 'got_online'))
expected = {'presence_available', 'got_online'}
self.assertEqual(events, expected,
"Incorrect events triggered: %s" % events)
@ -151,7 +151,7 @@ class TestStreamPresence(SlixTest):
type="subscribe" />
""")
expected = set(('presence_subscribe', 'changed_subscription'))
expected = {'presence_subscribe', 'changed_subscription'}
self.assertEqual(events, expected,
"Incorrect events triggered: %s" % events)
@ -185,7 +185,7 @@ class TestStreamPresence(SlixTest):
type="unsubscribed" />
""")
expected = set(('presence_subscribe', 'changed_subscription'))
expected = {'presence_subscribe', 'changed_subscription'}
self.assertEqual(events, expected,
"Incorrect events triggered: %s" % events)