diff options
author | Michael Foord <michael@voidspace.org.uk> | 2012-01-10 00:22:44 +0000 |
---|---|---|
committer | Michael Foord <michael@voidspace.org.uk> | 2012-01-10 00:22:44 +0000 |
commit | d311f604c97c49253ec316fe206af8da2ca95d4d (patch) | |
tree | 0b9608d50466c7223573a044edff2b1a0712846c /tests | |
parent | bb4646c35f1fda5bba00af04e18bef57a7c884fa (diff) | |
download | mock-d311f604c97c49253ec316fe206af8da2ca95d4d.tar.gz |
Fix ANY equality with some types in assert_called_with calls
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testhelpers.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/testhelpers.py b/tests/testhelpers.py index 345d648..51f8d13 100644 --- a/tests/testhelpers.py +++ b/tests/testhelpers.py @@ -10,6 +10,8 @@ from mock import ( mocksignature ) +from datetime import datetime + class SomeClass(object): def one(self, a, b): pass @@ -38,6 +40,13 @@ class AnyTest(unittest2.TestCase): self.assertEqual(str(ANY), '<ANY>') + def test_any_and_datetime(self): + mock = Mock() + mock(datetime.now(), foo=datetime.now()) + + mock.assert_called_with(ANY, foo=ANY) + + class CallTest(unittest2.TestCase): |