summaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
authorGustavo Niemeyer <gustavo@niemeyer.net>2007-12-04 22:50:33 -0200
committerGustavo Niemeyer <gustavo@niemeyer.net>2007-12-04 22:50:33 -0200
commit47587fc40380290700dd6f182c255397cd17e75f (patch)
tree369fb89864453a07d417eefd91dd53b269524aee /test.py
parent06eb72f4966e8ca4e5c10e4880562923d83b5179 (diff)
downloadmocker-47587fc40380290700dd6f182c255397cd17e75f.tar.gz
In MockerTestCase's constructor, copy attributes from the original method
into the wrapper.
Diffstat (limited to 'test.py')
-rwxr-xr-xtest.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/test.py b/test.py
index 6d7b774..8e3eb36 100755
--- a/test.py
+++ b/test.py
@@ -276,6 +276,15 @@ class MockerTestCaseTest(TestCase):
def test_has_expect(self):
self.assertTrue(self.test.expect is expect)
+ def test_attributes_are_the_same(self):
+ class MyTest(MockerTestCase):
+ def test_method(self):
+ pass
+ test_method.foo = "bar"
+ test = MyTest("test_method")
+ self.assertEquals(getattr(test.test_method, "im_class", None), MyTest)
+ self.assertEquals(getattr(test.test_method, "foo", None), "bar")
+
def test_constructor_is_the_same(self):
self.assertEquals(inspect.getargspec(TestCase.__init__),
inspect.getargspec(MockerTestCase.__init__))