Fix exception when calling reset_mock on a mock created with autospec

This commit is contained in:
Michael Foord 2012-06-09 17:31:59 +01:00
parent afc0c77b42
commit 75963643b1
3 changed files with 18 additions and 0 deletions

View file

@ -355,6 +355,13 @@ class SpecSignatureTest(unittest.TestCase):
self.assertEqual(mock(), 'foo')
def test_autospec_reset_mock(self):
m = create_autospec(int)
int(m)
m.reset_mock()
self.assertEqual(m.__int__.call_count, 0)
def test_mocking_unbound_methods(self):
class Foo(object):
def foo(self, foo):