summaryrefslogtreecommitdiffstats
path: root/testsuite/common.py
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/common.py')
-rw-r--r--testsuite/common.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/testsuite/common.py b/testsuite/common.py
index 0cb457461..e26d0be61 100644
--- a/testsuite/common.py
+++ b/testsuite/common.py
@@ -267,7 +267,7 @@ class Bcfg2TestCase(unittest.TestCase):
attributes. """
self.assertEqual(el1.tag, el2.tag, msg=msg)
self.assertEqual(el1.text, el2.text, msg=msg)
- self.assertItemsEqual(el1.attrib, el2.attrib, msg=msg)
+ self.assertItemsEqual(el1.attrib.items(), el2.attrib.items(), msg=msg)
self.assertEqual(len(el1.getchildren()),
len(el2.getchildren()))
for child1 in el1.getchildren():
@@ -275,10 +275,11 @@ class Bcfg2TestCase(unittest.TestCase):
self.assertIsNotNone(cname,
msg="Element %s has no 'name' attribute" %
child1.tag)
- children2 = el2.xpath("*[@name='%s']" % cname)
+ children2 = el2.xpath("%s[@name='%s']" % (child1.tag, cname))
self.assertEqual(len(children2), 1,
- msg="More than one element named %s" % cname)
- self.assertXMLEqual(child1, children2[0], msg=msg)
+ msg="More than one %s element named %s" % \
+ (child1.tag, cname))
+ self.assertXMLEqual(child1, children2[0], msg=msg)
class DBModelTestCase(Bcfg2TestCase):