summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichal Minar <miminar@redhat.com>2013-07-03 12:21:54 +0200
committerMichal Minar <miminar@redhat.com>2013-07-04 10:33:48 +0200
commit883835a79ce120d76973904cc81465fbb40dba3a (patch)
tree54ee7c9bd74d21d88bb1f76f3d2f9730a51ffb53 /src
parent3cf188c5f9d9daf47f4814afcf442184e84b89ff (diff)
downloadopenlmi-providers-883835a79ce120d76973904cc81465fbb40dba3a.tar.gz
openlmi-providers-883835a79ce120d76973904cc81465fbb40dba3a.tar.xz
openlmi-providers-883835a79ce120d76973904cc81465fbb40dba3a.zip
small software test improvements
Diffstat (limited to 'src')
-rwxr-xr-xsrc/software/test/test_installed_software_identity.py11
-rwxr-xr-xsrc/software/test/test_software_identity.py1
2 files changed, 4 insertions, 8 deletions
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()