summaryrefslogtreecommitdiff
path: root/tests/testhelpers.py
diff options
context:
space:
mode:
authorMichael Foord <michael@voidspace.org.uk>2012-03-13 14:39:59 -0700
committerMichael Foord <michael@voidspace.org.uk>2012-03-13 14:39:59 -0700
commit7b9de7e6e4271a013e0d7f1f8eba384ba87fd933 (patch)
tree67cdab36fff178f19c19048919794ce12251524e /tests/testhelpers.py
parent560a71bf309349bd92180c0c7788dee84bbd8044 (diff)
downloadmock-7b9de7e6e4271a013e0d7f1f8eba384ba87fd933.tar.gz
mocksignature and tests removed
Diffstat (limited to 'tests/testhelpers.py')
-rw-r--r--tests/testhelpers.py49
1 files changed, 24 insertions, 25 deletions
diff --git a/tests/testhelpers.py b/tests/testhelpers.py
index 8f8b6d7..1b3dd2f 100644
--- a/tests/testhelpers.py
+++ b/tests/testhelpers.py
@@ -6,8 +6,7 @@ from tests.support import unittest2, inPy3k
from mock import (
call, _Call, create_autospec,
- MagicMock, Mock, ANY, _CallList,
- mocksignature
+ MagicMock, Mock, ANY, _CallList
)
from datetime import datetime
@@ -424,7 +423,7 @@ class SpecSignatureTest(unittest2.TestCase):
def test_builtin_functions_types(self):
- # we could replace builtin functions / methods with a mocksignature
+ # we could replace builtin functions / methods with a function
# with *args / **kwargs signature. Using the builtin method type
# as a spec seems to work fairly well though.
class BuiltinSubclass(list):
@@ -814,28 +813,28 @@ class SpecSignatureTest(unittest2.TestCase):
class TestCallList(unittest2.TestCase):
def test_args_list_contains_call_list(self):
- for mock in Mock(), mocksignature(lambda *args, **kwargs: None):
- self.assertIsInstance(mock.call_args_list, _CallList)
-
- mock(1, 2)
- mock(a=3)
- mock(3, 4)
- mock(b=6)
-
- for kall in call(1, 2), call(a=3), call(3, 4), call(b=6):
- self.assertTrue(kall in mock.call_args_list)
-
- calls = [call(a=3), call(3, 4)]
- self.assertTrue(calls in mock.call_args_list)
- calls = [call(1, 2), call(a=3)]
- self.assertTrue(calls in mock.call_args_list)
- calls = [call(3, 4), call(b=6)]
- self.assertTrue(calls in mock.call_args_list)
- calls = [call(3, 4)]
- self.assertTrue(calls in mock.call_args_list)
-
- self.assertFalse(call('fish') in mock.call_args_list)
- self.assertFalse([call('fish')] in mock.call_args_list)
+ mock = Mock()
+ self.assertIsInstance(mock.call_args_list, _CallList)
+
+ mock(1, 2)
+ mock(a=3)
+ mock(3, 4)
+ mock(b=6)
+
+ for kall in call(1, 2), call(a=3), call(3, 4), call(b=6):
+ self.assertTrue(kall in mock.call_args_list)
+
+ calls = [call(a=3), call(3, 4)]
+ self.assertTrue(calls in mock.call_args_list)
+ calls = [call(1, 2), call(a=3)]
+ self.assertTrue(calls in mock.call_args_list)
+ calls = [call(3, 4), call(b=6)]
+ self.assertTrue(calls in mock.call_args_list)
+ calls = [call(3, 4)]
+ self.assertTrue(calls in mock.call_args_list)
+
+ self.assertFalse(call('fish') in mock.call_args_list)
+ self.assertFalse([call('fish')] in mock.call_args_list)
def test_call_list_str(self):