Ordering fixes for Python3.3
This commit is contained in:
parent
019a4b20ae
commit
36c11ad9de
@ -110,14 +110,14 @@ class Command(ElementBase):
|
|||||||
"""
|
"""
|
||||||
Return the set of allowable next actions.
|
Return the set of allowable next actions.
|
||||||
"""
|
"""
|
||||||
actions = []
|
actions = set()
|
||||||
actions_xml = self.find('{%s}actions' % self.namespace)
|
actions_xml = self.find('{%s}actions' % self.namespace)
|
||||||
if actions_xml is not None:
|
if actions_xml is not None:
|
||||||
for action in self.next_actions:
|
for action in self.next_actions:
|
||||||
action_xml = actions_xml.find('{%s}%s' % (self.namespace,
|
action_xml = actions_xml.find('{%s}%s' % (self.namespace,
|
||||||
action))
|
action))
|
||||||
if action_xml is not None:
|
if action_xml is not None:
|
||||||
actions.append(action)
|
actions.add(action)
|
||||||
return actions
|
return actions
|
||||||
|
|
||||||
def del_actions(self):
|
def del_actions(self):
|
||||||
|
@ -74,7 +74,7 @@ class Set(ElementBase):
|
|||||||
if fi is not None:
|
if fi is not None:
|
||||||
if val:
|
if val:
|
||||||
fi.attrib['index'] = val
|
fi.attrib['index'] = val
|
||||||
else:
|
elif 'index' in fi.attrib:
|
||||||
del fi.attrib['index']
|
del fi.attrib['index']
|
||||||
elif val:
|
elif val:
|
||||||
fi = ET.Element("{%s}first" % (self.namespace))
|
fi = ET.Element("{%s}first" % (self.namespace))
|
||||||
|
@ -49,7 +49,7 @@ class TestAdHocCommandStanzas(SleekTest):
|
|||||||
iq['command']['actions'] = ['prev', 'next']
|
iq['command']['actions'] = ['prev', 'next']
|
||||||
|
|
||||||
results = iq['command']['actions']
|
results = iq['command']['actions']
|
||||||
expected = ['prev', 'next']
|
expected = set(['prev', 'next'])
|
||||||
self.assertEqual(results, expected,
|
self.assertEqual(results, expected,
|
||||||
"Incorrect next actions: %s" % results)
|
"Incorrect next actions: %s" % results)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user