summaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'test.py')
-rwxr-xr-xtest.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/test.py b/test.py
index 68f3125..dc160b3 100755
--- a/test.py
+++ b/test.py
@@ -25,7 +25,7 @@ from mocker import \
mock_returner_recorder, FunctionRunner, Orderer, SpecChecker, \
spec_checker_recorder, match_params, ANY, IS, CONTAINS, IN, MATCH, ARGS, \
KWARGS, MatchError, PathExecuter, ProxyReplacer, Patcher, Undefined, \
- PatchedMethod, MockerTestCase, ReplayRestoreEvent, OnRestoreCaller
+ PatchedMethod, MockerTestCase, ReplayRestoreEvent, OnRestoreCaller, Expect
class TestCase(unittest.TestCase):
@@ -272,6 +272,13 @@ class ExpectTest(TestCase):
self.mocker.replay()
self.assertEquals(obj.attr, 42)
+ def test_explicit_expect_instance(self):
+ obj = self.mocker.mock()
+ myexpect = Expect(self.mocker)
+ myexpect(iter(obj)).generate([1, 2, 3]).count(1, 2)
+ self.mocker.replay()
+ self.assertEquals(list(obj), [1, 2, 3])
+
class MockerTestCaseTest(TestCase):