[Python-checkins] python/dist/src/Lib/test test_set.py,1.1,1.2

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Mon Nov 17 11:42:35 EST 2003


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1:/tmp/cvs-serv10398/Lib/test

Modified Files:
	test_set.py 
Log Message:
Various fixups (most suggested by Armin Rigo).



Index: test_set.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_set.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** test_set.py	16 Nov 2003 16:17:48 -0000	1.1
--- test_set.py	17 Nov 2003 16:42:33 -0000	1.2
***************
*** 153,156 ****
--- 153,163 ----
      thetype = set
  
+     def test_init(self):
+         s = set()
+         s.__init__(self.word)
+         self.assertEqual(s, set(self.word))
+         s.__init__(self.otherword)
+         self.assertEqual(s, set(self.otherword))
+ 
      def test_hash(self):
          self.assertRaises(TypeError, hash, self.s)
***************
*** 253,260 ****
--- 260,277 ----
                  self.assert_(c not in self.s)
  
+ class SetSubclass(set):
+     pass
+ 
+ class TestSetSubclass(TestSet):
+     thetype = SetSubclass
  
  class TestFrozenSet(TestJointOps):
      thetype = frozenset
  
+     def test_init(self):
+         s = frozenset()
+         s.__init__(self.word)
+         self.assertEqual(s, frozenset())
+ 
      def test_hash(self):
          self.assertEqual(hash(frozenset('abcdeb')), hash(frozenset('ebecda')))
***************
*** 274,277 ****
--- 291,300 ----
          self.assertEqual(hash(f), hash(f))
  
+ class FrozenSetSubclass(frozenset):
+     pass
+ 
+ class TestFrozenSetSubclass(TestFrozenSet):
+     thetype = FrozenSetSubclass
+ 
  # Tests taken from test_sets.py =============================================
  
***************
*** 1138,1142 ****
--- 1161,1167 ----
      test_classes = (
          TestSet,
+         TestSetSubclass,
          TestFrozenSet,
+         TestFrozenSetSubclass,
          TestSetOfSets,
          TestExceptionPropagation,





More information about the Python-checkins mailing list