From 883835a79ce120d76973904cc81465fbb40dba3a Mon Sep 17 00:00:00 2001 From: Michal Minar Date: Wed, 3 Jul 2013 12:21:54 +0200 Subject: small software test improvements --- src/software/test/test_installed_software_identity.py | 11 ++++------- src/software/test/test_software_identity.py | 1 - 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/software/test/test_installed_software_identity.py b/src/software/test/test_installed_software_identity.py index 72bb7cd..07189f0 100755 --- a/src/software/test/test_installed_software_identity.py +++ b/src/software/test/test_installed_software_identity.py @@ -182,10 +182,8 @@ class TestInstalledSoftwareIdentity(base.SoftwareBaseTestCase): 'Object path does not match for %s.' % pkg) # try to install second time - with self.assertRaises(pywbem.CIMError) as cm: - self.conn.CreateInstance(NewInstance=inst) - self.assertEqual(cm.exception.args[0], - pywbem.CIM_ERR_ALREADY_EXISTS) + self.assertRaisesCIM(pywbem.CIM_ERR_ALREADY_EXISTS + self.conn.CreateInstance, NewInstance=inst) @base.mark_dangerous def test_delete_instance(self): @@ -200,9 +198,8 @@ class TestInstalledSoftwareIdentity(base.SoftwareBaseTestCase): self.assertFalse(rpmcache.is_pkg_installed(pkg), "Failed to delete instance for %s." % pkg) - with self.assertRaises(pywbem.CIMError) as cm: - self.conn.DeleteInstance(InstanceName=objpath) - self.assertEqual(cm.exception.args[0], pywbem.CIM_ERR_NOT_FOUND) + self.assertRaisesCIM(pywbem.CIM_ERR_NOT_FOUND, + self.conn.DeleteInstance, InstanceName=objpath) @base.mark_tedious def test_get_system_referents(self): diff --git a/src/software/test/test_software_identity.py b/src/software/test/test_software_identity.py index 3b94e01..47eee28 100755 --- a/src/software/test/test_software_identity.py +++ b/src/software/test/test_software_identity.py @@ -41,7 +41,6 @@ class TestSoftwareIdentity(base.SoftwareBaseTestCase): #pylint: disable=R0904 def make_op(self, pkg, newer=True): """ - @param ses SoftwareElementState property value @return object path of SoftwareIdentity """ objpath = self.objpath.copy() -- cgit