Back to index

python3.2  3.2.2
Public Member Functions
test.test_binop.OperationOrderTests Class Reference

List of all members.

Public Member Functions

def test_comparison_orders

Detailed Description

Definition at line 361 of file

Member Function Documentation

Definition at line 362 of file

00363     def test_comparison_orders(self):
00364         self.assertEqual(op_sequence(eq, A, A), ['A.__eq__', 'A.__eq__'])
00365         self.assertEqual(op_sequence(eq, A, B), ['A.__eq__', 'B.__eq__'])
00366         self.assertEqual(op_sequence(eq, B, A), ['B.__eq__', 'A.__eq__'])
00367         # C is a subclass of B, so C.__eq__ is called first
00368         self.assertEqual(op_sequence(eq, B, C), ['C.__eq__', 'B.__eq__'])
00369         self.assertEqual(op_sequence(eq, C, B), ['C.__eq__', 'B.__eq__'])
00371         self.assertEqual(op_sequence(le, A, A), ['A.__le__', 'A.__ge__'])
00372         self.assertEqual(op_sequence(le, A, B), ['A.__le__', 'B.__ge__'])
00373         self.assertEqual(op_sequence(le, B, A), ['B.__le__', 'A.__ge__'])
00374         self.assertEqual(op_sequence(le, B, C), ['C.__ge__', 'B.__le__'])
00375         self.assertEqual(op_sequence(le, C, B), ['C.__le__', 'B.__ge__'])

Here is the call graph for this function:

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