Back to index

python3.2  3.2.2
Public Member Functions | Static Public Attributes
test.test_set.TestSubsets Class Reference
Inheritance diagram for test.test_set.TestSubsets:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def test_issubset

Static Public Attributes

dictionary case2method
dictionary reverse

Detailed Description

Definition at line 1206 of file test_set.py.


Member Function Documentation

Definition at line 1220 of file test_set.py.

01220 
01221     def test_issubset(self):
01222         x = self.left
01223         y = self.right
01224         for case in "!=", "==", "<", "<=", ">", ">=":
01225             expected = case in self.cases
01226             # Test the binary infix spelling.
01227             result = eval("x" + case + "y", locals())
01228             self.assertEqual(result, expected)
01229             # Test the "friendly" method-name spelling, if one exists.
01230             if case in TestSubsets.case2method:
01231                 method = getattr(x, TestSubsets.case2method[case])
01232                 result = method(y)
01233                 self.assertEqual(result, expected)
01234 
01235             # Now do the same for the operands reversed.
01236             rcase = TestSubsets.reverse[case]
01237             result = eval("y" + rcase + "x", locals())
01238             self.assertEqual(result, expected)
01239             if rcase in TestSubsets.case2method:
01240                 method = getattr(y, TestSubsets.case2method[rcase])
01241                 result = method(x)
01242                 self.assertEqual(result, expected)
01243 #------------------------------------------------------------------------------

Here is the call graph for this function:


Member Data Documentation

Initial value:
{"<=": "issubset",
                   ">=": "issuperset",
                  }

Definition at line 1208 of file test_set.py.

Initial value:
{"==": "==",
               "!=": "!=",
               "<":  ">",
               ">":  "<",
               "<=": ">=",
               ">=": "<=",
              }

Definition at line 1212 of file test_set.py.


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