Ordering fixes for Python3.3

This commit is contained in:
Lance Stout 2012-06-19 18:19:44 -07:00
parent 019a4b20ae
commit 36c11ad9de
3 changed files with 4 additions and 4 deletions

View file

@ -110,14 +110,14 @@ class Command(ElementBase):
"""
Return the set of allowable next actions.
"""
actions = []
actions = set()
actions_xml = self.find('{%s}actions' % self.namespace)
if actions_xml is not None:
for action in self.next_actions:
action_xml = actions_xml.find('{%s}%s' % (self.namespace,
action))
if action_xml is not None:
actions.append(action)
actions.add(action)
return actions
def del_actions(self):

View file

@ -74,7 +74,7 @@ class Set(ElementBase):
if fi is not None:
if val:
fi.attrib['index'] = val
else:
elif 'index' in fi.attrib:
del fi.attrib['index']
elif val:
fi = ET.Element("{%s}first" % (self.namespace))

View file

@ -49,7 +49,7 @@ class TestAdHocCommandStanzas(SleekTest):
iq['command']['actions'] = ['prev', 'next']
results = iq['command']['actions']
expected = ['prev', 'next']
expected = set(['prev', 'next'])
self.assertEqual(results, expected,
"Incorrect next actions: %s" % results)