diff options
author | Gustavo Niemeyer <gustavo@niemeyer.net> | 2007-12-04 22:50:33 -0200 |
---|---|---|
committer | Gustavo Niemeyer <gustavo@niemeyer.net> | 2007-12-04 22:50:33 -0200 |
commit | 47587fc40380290700dd6f182c255397cd17e75f (patch) | |
tree | 369fb89864453a07d417eefd91dd53b269524aee /test.py | |
parent | 06eb72f4966e8ca4e5c10e4880562923d83b5179 (diff) | |
download | mocker-47587fc40380290700dd6f182c255397cd17e75f.tar.gz |
In MockerTestCase's constructor, copy attributes from the original method
into the wrapper.
Diffstat (limited to 'test.py')
-rwxr-xr-x | test.py | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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__)) |