Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.equal() should convert mock._CallList instances to lists #41

Closed
clarete opened this issue Oct 26, 2013 · 0 comments
Closed

.equal() should convert mock._CallList instances to lists #41

clarete opened this issue Oct 26, 2013 · 0 comments

Comments

@clarete
Copy link
Collaborator

clarete commented Oct 26, 2013

Otherwise, the user has to do that all the time to avoid the following error:

screen shot 2013-10-25 at 9 25 25 pm

Here's a basic test case

import mock

def test_equals_handles_mock_call_list():
    ".equal() Should convert mock._CallList instances to lists"

    # Given the following mocked callback
    callback = mock.Mock()

    # When I call the callback with a few parameters twice
    callback(a=1, b=2)
    callback(a=3, b=4)

    # Then I see I can compare the call list without manually
    # converting anything
    callback.call_args_list.should.equal([
        mock.call(a=1, b=2),
        mock.call(a=3, b=4),
    ])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant