Index: test_sets.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_sets.py,v retrieving revision 1.19 diff -c -r1.19 test_sets.py *** test_sets.py 15 Jan 2003 16:15:38 -0000 1.19 --- test_sets.py 1 Mar 2003 17:40:41 -0000 *************** *** 638,643 **** --- 638,657 ---- #============================================================================== + class TestCompareWithForeignType(unittest.TestCase): + + def test_equality(self): + self.assertEqual(Set('a') == 2, False) + self.assertEqual(Set('a') != 2, True) + + def test_inequalities(self): + self.assertRaises(TypeError, Set('a').__lt__, 2) + self.assertRaises(TypeError, Set('a').__le__, 2) + self.assertRaises(TypeError, Set('a').__gt__, 2) + self.assertRaises(TypeError, Set('a').__ge__, 2) + + #============================================================================== + libreftest = """ Example from the Library Reference: Doc/lib/libsets.tex *************** *** 692,697 **** --- 706,712 ---- TestCopyingTriple, TestCopyingTuple, TestCopyingNested, + TestCompareWithForeignType, ): suite.addTest(unittest.makeSuite(klass)) return suite