[Python-checkins] CVS: python/dist/src/Lib/test test_dircache.py,1.2,1.3

Tim Peters tim_one@users.sourceforge.net
Fri, 20 Jul 2001 19:22:16 -0700


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

Modified Files:
	test_dircache.py 
Log Message:
On WIndows, skip the part of test_dircache that can't work on Windows.


Index: test_dircache.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_dircache.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** test_dircache.py	2001/07/21 01:41:30	1.2
--- test_dircache.py	2001/07/21 02:22:14	1.3
***************
*** 6,10 ****
  import unittest
  from test_support import run_unittest, TESTFN
! import dircache, os, time
  
  
--- 6,10 ----
  import unittest
  from test_support import run_unittest, TESTFN
! import dircache, os, time, sys
  
  
***************
*** 41,52 ****
          self.assert_(dircache.listdir(self.tempdir) is entries)
  
!         # Sadly, dircache has the same granularity as stat.mtime, and so
!         # can't notice any changes that occured within 1 sec of the last
!         # time it examined a directory.
!         time.sleep(1)
!         self.writeTemp("test1")
!         entries = dircache.listdir(self.tempdir)
!         self.assertEquals(entries, ['test1'])
!         self.assert_(dircache.listdir(self.tempdir) is entries)
  
          ## UNSUCCESSFUL CASES
--- 41,58 ----
          self.assert_(dircache.listdir(self.tempdir) is entries)
  
!         # Directories aren't "files" on Windows, and directory mtime has
!         # nothing to do with when files under a directory get created.
!         # That is, this test can't possibly work under Windows -- dircache
!         # is only good for capturing a one-shot snapshot there.
! 
!         if sys.platform[:3] not in ('win', 'os2'):
!             # Sadly, dircache has the same granularity as stat.mtime, and so
!             # can't notice any changes that occured within 1 sec of the last
!             # time it examined a directory.
!             time.sleep(1)
!             self.writeTemp("test1")
!             entries = dircache.listdir(self.tempdir)
!             self.assertEquals(entries, ['test1'])
!             self.assert_(dircache.listdir(self.tempdir) is entries)
  
          ## UNSUCCESSFUL CASES