summaryrefslogtreecommitdiffstats
path: root/testsuite/common.py
diff options
context:
space:
mode:
authorTim Laszlo <tim.laszlo@gmail.com>2012-12-03 16:16:41 -0600
committerTim Laszlo <tim.laszlo@gmail.com>2012-12-03 16:16:41 -0600
commit350db854319af526818c2ffcac285ae445b0213d (patch)
treed13d486ab856c37ad194653f46ac329bb75b3338 /testsuite/common.py
parenta8c2c14b0bf39d101f3ecc4b3aafc01fabad02d5 (diff)
parent2983b0c358ef25e7c34ccdeb3ab1f8d6a6f9ae90 (diff)
downloadbcfg2-350db854319af526818c2ffcac285ae445b0213d.tar.gz
bcfg2-350db854319af526818c2ffcac285ae445b0213d.tar.bz2
bcfg2-350db854319af526818c2ffcac285ae445b0213d.zip
Merge branch 'master' of github.com:Bcfg2/bcfg2
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):