[Python-checkins] python/dist/src/Lib/test test_tempfile.py,1.3,1.4

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Fri, 09 Aug 2002 11:13:53 -0700


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

Modified Files:
	test_tempfile.py 
Log Message:
There's no distinction among 'user', 'group' and 'world' permissions
on Win32, so tests that assume there are such distinctions can't
pass.  Fiddled them to work.


Index: test_tempfile.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_tempfile.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** test_tempfile.py	9 Aug 2002 18:01:01 -0000	1.3
--- test_tempfile.py	9 Aug 2002 18:13:51 -0000	1.4
***************
*** 310,314 ****
          file = self.do_create()
          mode = stat.S_IMODE(os.stat(file.name).st_mode)
!         self.assertEqual(mode, 0600)
  
      def test_noinherit(self):
--- 310,320 ----
          file = self.do_create()
          mode = stat.S_IMODE(os.stat(file.name).st_mode)
!         expected = 0600
!         if sys.platform in ('win32',):
!             # There's no distinction among 'user', 'group' and 'world';
!             # replicate the 'user' bits.
!             user = expected >> 6
!             expected = user * (1 + 8 + 64)
!         self.assertEqual(mode, expected)
  
      def test_noinherit(self):
***************
*** 514,518 ****
          try:
              mode = stat.S_IMODE(os.stat(dir).st_mode)
!             self.assertEqual(mode, 0700)
          finally:
              os.rmdir(dir)
--- 520,530 ----
          try:
              mode = stat.S_IMODE(os.stat(dir).st_mode)
!             expected = 0700
!             if sys.platform in ('win32',):
!                 # There's no distinction among 'user', 'group' and 'world';
!                 # replicate the 'user' bits.
!                 user = expected >> 6
!                 expected = user * (1 + 8 + 64)
!             self.assertEqual(mode, expected)
          finally:
              os.rmdir(dir)