hRobert12 / mock

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

Assert that values are not equal to certain values with NOT #187

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
A natural counterpart to the ANY helper is the NOT helper, which would allow 
you to assert that an argument or value is anything except some certain value. 
Example:

    >>> mock = Mock(return_value=None)
    >>> mock('foo')
    >>> mock.assert_called_once_with(NOT('bar', 'baz', 'qux'))

Attached is a patch for NOT with tests and mediocre documentation. Let me know 
if any more changes are needed. :D

Original issue reported on code.google.com by Osmose1...@gmail.com on 6 Nov 2012 at 4:19

Attachments: