[Python-checkins] python/dist/src/Lib/test test_set.py,1.12,1.13

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Fri Jul 9 06:51:26 CEST 2004


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26486

Modified Files:
	test_set.py 
Log Message:
* fix the print test
* add more __init__ tests



Index: test_set.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_set.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** test_set.py	30 May 2004 07:26:47 -0000	1.12
--- test_set.py	9 Jul 2004 04:51:24 -0000	1.13
***************
*** 5,8 ****
--- 5,9 ----
  import copy
  import pickle
+ import os
  
  class PassThru(Exception):
***************
*** 202,205 ****
--- 203,208 ----
          s.__init__(self.otherword)
          self.assertEqual(s, set(self.otherword))
+         self.assertRaises(TypeError, s.__init__, s, 2);
+         self.assertRaises(TypeError, s.__init__, 1);
  
      def test_constructor_identity(self):
***************
*** 437,440 ****
--- 440,454 ----
              self.assertEqual(repr(self.set), self.repr)
  
+     def test_print(self):
+         try:
+             fo = open(test_support.TESTFN, "wb")
+             print >> fo, self.set,
+             fo.close()
+             fo = open(test_support.TESTFN, "rb")
+             self.assertEqual(fo.read(), repr(self.set))
+         finally:
+             fo.close()
+             os.remove(test_support.TESTFN)
+ 
      def test_length(self):
          self.assertEqual(len(self.set), self.length)



More information about the Python-checkins mailing list