The test was checking the name directly, which is wrong, due special
characters imcompatibility. So, if title is present, use it.
Signed-off-by: Ramon Medeiros <ramonn(a)linux.vnet.ibm.com>
---
tests/test_vmtemplate.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/tests/test_vmtemplate.py b/tests/test_vmtemplate.py
index b504fbc..4df1c7f 100644
--- a/tests/test_vmtemplate.py
+++ b/tests/test_vmtemplate.py
@@ -86,7 +86,13 @@ class VMTemplateTests(unittest.TestCase):
t = VMTemplate({'name': 'test-template', 'cdrom':
self.iso})
xml = t.to_vm_xml('test-vm', vm_uuid, graphics=graphics)
self.assertEquals(vm_uuid, xpath_get_text(xml, "/domain/uuid")[0])
- self.assertEquals('test-vm', xpath_get_text(xml,
"/domain/name")[0])
+
+ name = xpath_get_text(xml, "/domain/name")[0]
+ title = xpath_get_text(xml, "/domain/title")
+ if len(title) > 0:
+ name = title[0]
+
+ self.assertEquals('test-vm', name)
expr = "/domain/devices/graphics/@type"
self.assertEquals(graphics['type'], xpath_get_text(xml, expr)[0])
expr = "/domain/devices/graphics/@listen"
--
2.1.0