From 47587fc40380290700dd6f182c255397cd17e75f Mon Sep 17 00:00:00 2001 From: Gustavo Niemeyer Date: Tue, 4 Dec 2007 22:50:33 -0200 Subject: In MockerTestCase's constructor, copy attributes from the original method into the wrapper. --- test.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test.py') 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__)) -- cgit v1.2.1