Skip to content

Commit

Permalink
Fixed that recent change in pywbem mocker breaks sample test method p…
Browse files Browse the repository at this point in the history
…rovider

Details:

* Adjusted to changes in the pywbem mock support for method providers, in the
  sample method provider simple_mock_invokemethod_pywbem_V1.py. (See issue #646)

Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
  • Loading branch information
andy-maier committed Jun 25, 2020
1 parent 20f8d07 commit 11a2133
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 3 additions & 0 deletions docs/changes.rst
Expand Up @@ -30,6 +30,9 @@ Released: not yet

* Pinned version of colorama to <0.4.0 for Python <=3.4.

* Adjusted to changes in the pywbem mock support for method providers, in the
sample method provider simple_mock_invokemethod_pywbem_V1.py. (See issue #646)

**Enhancements:**

* Enabled installation using 'setup.py install' from unpacked source distribution
Expand Down
9 changes: 4 additions & 5 deletions tests/unit/simple_mock_invokemethod_pywbem_V1.py
Expand Up @@ -59,14 +59,13 @@ def InvokeMethod(self, namespace, MethodName, ObjectName, Params):

if isinstance(ObjectName, CIMInstanceName):
instance_store = self.cimrepository.get_instance_store(namespace)
inst = self.find_instance(ObjectName, instance_store, copy=False)
if inst is None:
if not instance_store.object_exists(ObjectName):
raise CIMError(
CIM_ERR_NOT_FOUND,
"Instance {0} does not exist in CIM repository, "
"namespace {1}".format(ObjectName, namespace))
# This method expects a single parameter input
"Instance {0} does not exist in CIM repository",
format(ObjectName))

# This method expects a single parameter input
return_params = []
if MethodName.lower() == 'fuzzy':
if Params:
Expand Down

0 comments on commit 11a2133

Please sign in to comment.