Skip to content

Calling another Mocked DBus Method inside the Custom call back function of a mocked method #171

Description

@AlldreenDev

Hi. Thanks for developing this module as it has been used widely in our project for component testing.

I have issue in calling a mocked DBus method inside a custom call back function of a mocked method.

The below are my two mock methods:

      dbus_mock.AddMethod(' ', 'SetValue', 'sv', ' ', ' ')

      dbus_mock.AddMethod( ' ', 'GetValue' , 's' , 'v', getValuefun())

The call back function:

 def getValuefun():

     calls_made = dbus_mock.GetMethodCalls('SetValue')

     print(calls_made) # This output should be returned

     ret_val = 'ret = "{}"'.format(calls_made)

     return  ret_val

On execution of this function, I am getting empty array for the "calls_made" variable. Is this the correct way of doing this ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions