What steps will reproduce the problem? 1. When asserting the order of calls, the mock framework ALWAYS returns true, since the internal "_CallList" is used for "contains" checks:
mock = Mock() mock.tell(bye_evt) mock.tell(hello_evt)
mock.tell.assert_has_calls([call(bye_evt), call(hello_evt)]) >> TRUE mock.tell.assert_has_calls([call(hello_evt), call(bye_evt)]) >> TRUE
- Both of the above will return true, REGARDLESS of the order of calls.
What is the expected output? What do you see instead?
It should be TRUE for the first assert, and FALSE for the second!
What version of the product are you using? On what operating system? 1.0.1
How has this passed ANY tests? Arrgggh.. this took me forever to figure out.
Comment #1
Posted on Apr 7, 2015 by Helpful MonkeyThis is the documented behaviour. Please read the documentation for this assert method. There is an optional argument for enforcing the order.
Status: Invalid
Labels:
Type-Defect
Priority-Medium