summaryrefslogtreecommitdiffstats
path: root/src/software/test/test_software_package.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/software/test/test_software_package.py')
-rwxr-xr-xsrc/software/test/test_software_package.py43
1 files changed, 28 insertions, 15 deletions
diff --git a/src/software/test/test_software_package.py b/src/software/test/test_software_package.py
index d0144ca..3411678 100755
--- a/src/software/test/test_software_package.py
+++ b/src/software/test/test_software_package.py
@@ -61,15 +61,20 @@ class TestSoftwarePackage(common.SoftwareBaseTestCase): #pylint: disable=R0904
common.remove_pkg(pkg.name)
objpath = self.make_op(pkg, ses=1)
inst = self.conn.GetInstance(InstanceName=objpath, LocalOnly=False)
- self.assertEqual(inst.path, objpath)
+ self.assertEqual(inst.path, objpath,
+ "Object paths should match for %s"%pkg)
for key in self.KEYS:
- self.assertTrue(inst.properties.has_key(key))
- self.assertEqual(inst.path[key], inst[key])
- self.assertEqual(inst['Release'], pkg.up_rel)
+ self.assertTrue(inst.properties.has_key(key),
+ "OP is missing \"%s\" key for package %s"%(key, pkg))
+ self.assertEqual(inst.path[key], inst[key],
+ "Object paths of instance should match for %s"%pkg)
+ self.assertEqual(pkg.up_rel, inst['Release'],
+ "Release property should match for %s"%pkg)
common.install_pkg(pkg)
objpath['SoftwareElementState'] = pywbem.Uint16(2)
inst = self.conn.GetInstance(InstanceName=objpath, LocalOnly=False)
- self.assertEqual(inst.path, objpath)
+ self.assertEqual(inst.path, objpath,
+ "Object paths should match for %s"%pkg)
# try to leave out epoch part
if pkg.epoch == "0":
@@ -93,18 +98,23 @@ class TestSoftwarePackage(common.SoftwareBaseTestCase): #pylint: disable=R0904
(rval, oparms) = self.conn.InvokeMethod(
MethodName="Install",
ObjectName=objpath)
- self.assertEqual(rval, pywbem.Uint32(1))
- self.assertEqual(len(oparms), 1)
+ self.assertEqual(pywbem.Uint32(1), rval,
+ "Installation of %s should be successful"%pkg)
+ self.assertEqual(1, len(oparms))
self.assertTrue(oparms.has_key('Installed'))
objpath['SoftwareElementState'] = pywbem.Uint16(2)
- self.assertEqual(oparms['Installed'], objpath)
- self.assertTrue(common.is_installed(pkg.name))
+ self.assertEqual(oparms['Installed'], objpath,
+ "Object paths should match for %s"%pkg)
+ self.assertTrue(common.is_installed(pkg.name),
+ "Package %s must be installed"%pkg)
(rval, oparms) = self.conn.InvokeMethod(
MethodName="Install",
ObjectName=objpath)
- self.assertEqual(rval, pywbem.Uint32(0))
+ self.assertEqual(pywbem.Uint32(0), rval,
+ "Installation of %s should fail"%pkg)
self.assertEqual(len(oparms), 1)
- self.assertEqual(oparms['Installed'], objpath)
+ self.assertEqual(oparms['Installed'], objpath,
+ "Object paths should match for %s"%pkg)
@common.mark_dangerous
def test_method_remove(self):
@@ -118,14 +128,17 @@ class TestSoftwarePackage(common.SoftwareBaseTestCase): #pylint: disable=R0904
(rval, oparms) = self.conn.InvokeMethod(
MethodName="Remove",
ObjectName=objpath)
- self.assertEqual(rval, pywbem.Uint16(1))
- self.assertEqual(len(oparms), 0)
- self.assertFalse(common.is_installed(pkg.name))
+ self.assertEqual(pywbem.Uint16(1), rval,
+ "Removal of package should succeed"%pkg)
+ self.assertEqual(0, len(oparms))
+ self.assertFalse(common.is_installed(pkg.name),
+ "Package %s should not be installed"%pkg)
objpath["SoftwareElementState"] = pywbem.Uint16(1)
(rval, oparms) = self.conn.InvokeMethod(
MethodName="Remove",
ObjectName=objpath)
- self.assertEqual(rval, pywbem.Uint32(0))
+ self.assertEqual(pywbem.Uint32(0), rval,
+ "Removal of %s should fail"%pkg)
self.assertEqual(len(oparms), 0)
def suite():