summaryrefslogtreecommitdiff
path: root/mox_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'mox_test.py')
-rwxr-xr-xmox_test.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/mox_test.py b/mox_test.py
index ea12176..c7432df 100755
--- a/mox_test.py
+++ b/mox_test.py
@@ -1759,6 +1759,12 @@ class MoxTestBaseMultipleInheritanceTest(mox.MoxTestBase, MyTestCase):
super(MoxTestBaseMultipleInheritanceTest, self).testMethodOverride()
self.assertEquals(43, self.another_critical_variable)
+class MoxTestDontMockProperties(MoxTestBaseTest):
+ def testPropertiesArentMocked(self):
+ mock_class = self.mox.CreateMock(ClassWithProperties)
+ self.assertRaises(mox.UnknownMethodCallError, lambda:
+ mock_class.prop_attr)
+
class TestClass:
"""This class is used only for testing the mock framework"""
@@ -1819,6 +1825,7 @@ class TestClass:
def __iter__(self):
pass
+
class ChildClass(TestClass):
"""This inherits from TestClass."""
def __init__(self):
@@ -1837,6 +1844,15 @@ class CallableClass(object):
def __call__(self, param):
return param
+class ClassWithProperties(object):
+ def setter_attr(self, value):
+ pass
+
+ def getter_attr(self):
+ pass
+
+ prop_attr = property(getter_attr, setter_attr)
+
class SubscribtableNonIterableClass(object):
def __getitem__(self, index):