Back to index

python3.2  3.2.2
Public Member Functions
test.test_super.TestSuper Class Reference

List of all members.

Public Member Functions

def test_basics_working
def test_class_getattr_working
def test_subclass_no_override_working
def test_unbound_method_transfer_working
def test_class_methods_still_working
def test_super_in_class_methods_working
def test_super_with_closure

Detailed Description

Definition at line 45 of file test_super.py.


Member Function Documentation

Definition at line 47 of file test_super.py.

00047 
00048     def test_basics_working(self):
00049         self.assertEqual(D().f(), 'ABCD')

Here is the call graph for this function:

Definition at line 50 of file test_super.py.

00050 
00051     def test_class_getattr_working(self):
00052         self.assertEqual(D.f(D()), 'ABCD')

Here is the call graph for this function:

Definition at line 61 of file test_super.py.

00061 
00062     def test_class_methods_still_working(self):
00063         self.assertEqual(A.cm(), (A, 'A'))
00064         self.assertEqual(A().cm(), (A, 'A'))
00065         self.assertEqual(G.cm(), (G, 'A'))
00066         self.assertEqual(G().cm(), (G, 'A'))

Here is the call graph for this function:

Definition at line 53 of file test_super.py.

00053 
00054     def test_subclass_no_override_working(self):
00055         self.assertEqual(E().f(), 'ABCD')
00056         self.assertEqual(E.f(E()), 'ABCD')

Here is the call graph for this function:

Definition at line 67 of file test_super.py.

00067 
00068     def test_super_in_class_methods_working(self):
00069         d = D()
00070         self.assertEqual(d.cm(), (d, (D, (D, (D, 'A'), 'B'), 'C'), 'D'))
00071         e = E()
00072         self.assertEqual(e.cm(), (e, (E, (E, (E, 'A'), 'B'), 'C'), 'D'))

Here is the call graph for this function:

Definition at line 73 of file test_super.py.

00073 
00074     def test_super_with_closure(self):
00075         # Issue4360: super() did not work in a function that
00076         # contains a closure
00077         class E(A):
00078             def f(self):
00079                 def nested():
00080                     self
00081                 return super().f() + 'E'
00082 
00083         self.assertEqual(E().f(), 'AE')
00084 

Definition at line 57 of file test_super.py.

00057 
00058     def test_unbound_method_transfer_working(self):
00059         self.assertEqual(F().f(), 'ABCD')
00060         self.assertEqual(F.f(F()), 'ABCD')

Here is the call graph for this function:


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