Back to index

python3.2  3.2.2
Public Member Functions
test.test_property.PropertyTests Class Reference

List of all members.

Public Member Functions

def test_property_decorator_baseclass
def test_property_decorator_subclass
def test_property_decorator_subclass_doc
def test_property_decorator_baseclass_doc
def test_property_decorator_doc
def test_property_getter_doc_override

Detailed Description

Definition at line 80 of file test_property.py.


Member Function Documentation

Definition at line 81 of file test_property.py.

00081 
00082     def test_property_decorator_baseclass(self):
00083         # see #1620
00084         base = BaseClass()
00085         self.assertEqual(base.spam, 5)
00086         self.assertEqual(base._spam, 5)
00087         base.spam = 10
00088         self.assertEqual(base.spam, 10)
00089         self.assertEqual(base._spam, 10)
00090         delattr(base, "spam")
00091         self.assertTrue(not hasattr(base, "spam"))
00092         self.assertTrue(not hasattr(base, "_spam"))
00093         base.spam = 20
00094         self.assertEqual(base.spam, 20)
00095         self.assertEqual(base._spam, 20)

Here is the call graph for this function:

Definition at line 111 of file test_property.py.

00111 
00112     def test_property_decorator_baseclass_doc(self):
00113         base = BaseClass()
00114         self.assertEqual(base.__class__.spam.__doc__, "BaseClass.getter")

Here is the call graph for this function:

Definition at line 115 of file test_property.py.

00115 
00116     def test_property_decorator_doc(self):
00117         base = PropertyDocBase()
00118         sub = PropertyDocSub()
00119         self.assertEqual(base.__class__.spam.__doc__, "spam spam spam")
00120         self.assertEqual(sub.__class__.spam.__doc__, "spam spam spam")

Here is the call graph for this function:

Definition at line 96 of file test_property.py.

00096 
00097     def test_property_decorator_subclass(self):
00098         # see #1620
00099         sub = SubClass()
00100         self.assertRaises(PropertyGet, getattr, sub, "spam")
00101         self.assertRaises(PropertySet, setattr, sub, "spam", None)
00102         self.assertRaises(PropertyDel, delattr, sub, "spam")

Here is the call graph for this function:

Definition at line 105 of file test_property.py.

00105 
00106     def test_property_decorator_subclass_doc(self):
00107         sub = SubClass()
00108         self.assertEqual(sub.__class__.spam.__doc__, "SubClass.getter")

Here is the call graph for this function:

Definition at line 123 of file test_property.py.

00123 
00124     def test_property_getter_doc_override(self):
00125         newgettersub = PropertySubNewGetter()
00126         self.assertEqual(newgettersub.spam, 5)
00127         self.assertEqual(newgettersub.__class__.spam.__doc__, "new docstring")
00128         newgetter = PropertyNewGetter()
00129         self.assertEqual(newgetter.spam, 8)
00130         self.assertEqual(newgetter.__class__.spam.__doc__, "new docstring")
00131 
00132 
# Issue 5890: subclasses of property do not preserve method __doc__ strings

Here is the call graph for this function:


The documentation for this class was generated from the following file: