def check_calls_with(call_mock, param, value):
    """ Given a mocked object, check if it was called with a given parameter and/or value.
    :param call_mock: the mock object to check
    :type  call_mock: mock.call
    :param param    : check if it was called with this given 'param'
    :type  param    : string
    :param value    : check if it was called with this given value for the 'param'
                      If the value is not important, call this with mock.ANY
    """
    for cm in call_mock.call_args_list:
        if param in cm[1]:
            if cm[1][param] == value:
                return True
    return False