Open lerovitch opened 10 years ago
thanks for the report @lerovitch!
That a strange use case, although it should probably be supported too. The same can be accomplished with the following expression:
>>> spam.eggs.assert_called_with(should.be_dict.and_not_have_key('foo'))
AssertionError: Expected call: eggs((a dict and not a dictionary containing key 'foo'))
Actual call: eggs({'bar': 'bar', 'foo': 'foo'})
well, omit the first assert
>>> import mock
>>> spam = mock.MagicMock()
>>> spam.eggs({'foo': 'foo', 'bar': 'bar'})
>>> from pyshould import should_not
>>> spam.eggs.assert_called_with(should_not.have_key('foo'))
AssertionError: Expected call: eggs(a dictionary containing key 'foo')
Actual call: eggs({'foo': 'foo', 'bar': 'bar'})
Also, thx for your advice as it's better to concatenate assertions with operators like 'and'
The message should say something like