jsatt / mock

Automatically exported from code.google.com/p/mock
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Unexpected behaviour of assert_has_calls with empty list as argument #243

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Example:
import mock                                                                     

mmock = mock.MagicMock()                                                        
mmock.foobar("baz")                                                             
mmock.assert_has_calls([])  # No exception raised. Why?                         
mmock.assert_has_calls(['x'])  # Exception raised as expected.

What is the expected output? What do you see instead?
Expected an exception when called assert_has_calls with empty list.

What version of the product are you using? On what operating system?
mock==1.0.1
Ubuntu 14.04.1 LTS

Please provide any additional information below.
_CallList -> __contains__ might check for empty list as value?

Original issue reported on code.google.com by andras.s...@gmail.com on 9 Jan 2015 at 1:47