summaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
authorGustavo Niemeyer <gustavo@niemeyer.net>2007-11-04 21:56:07 -0500
committerGustavo Niemeyer <gustavo@niemeyer.net>2007-11-04 21:56:07 -0500
commit777258d38db0f8bf8565034a4e95182be0ac380b (patch)
treea659e0b4c9bfbe1418c3bc6029129922db4a45b0 /test.py
parenta64963e5ce780156b2007e31efbc5e69f5e55d79 (diff)
downloadmocker-777258d38db0f8bf8565034a4e95182be0ac380b.tar.gz
Implemented Mocker.generate().
Diffstat (limited to 'test.py')
-rwxr-xr-xtest.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test.py b/test.py
index fe259a0..f768668 100755
--- a/test.py
+++ b/test.py
@@ -127,6 +127,16 @@ class IntegrationTest(unittest.TestCase):
self.assertEquals(obj.x(24), 42)
self.assertEquals(calls, [24])
+ def test_generate(self):
+ obj = self.mocker.mock()
+ obj.x(24)
+ self.mocker.generate([1, 2, 3])
+ self.mocker.replay()
+ result = obj.x(24)
+ def g(): yield None
+ self.assertEquals(type(result), type(g()))
+ self.assertEquals(list(result), [1, 2, 3])
+
def test_proxy(self):
class C(object):
def sum(self, *args):