[Python-checkins] CVS: python/dist/src/Lib/test test_ntpath.py,1.14,1.15

Fred L. Drake fdrake@users.sourceforge.net
Mon, 14 Jan 2002 19:46:45 -0800


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

Modified Files:
	test_ntpath.py 
Log Message:
Only test ntpath.abspath() on Windows.  This allows the rest of the module to
be tested regardless of the host platform.


Index: test_ntpath.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_ntpath.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** test_ntpath.py	2001/11/05 21:33:04	1.14
--- test_ntpath.py	2002/01/15 03:46:43	1.15
***************
*** 42,47 ****
  tester('ntpath.isabs("\\foo\\bar")', 1)
  
- tester('ntpath.abspath("C:\\")', "C:\\")
- 
  tester('ntpath.commonprefix(["/home/swenson/spam", "/home/swen/spam"])',
         "/home/swen")
--- 42,45 ----
***************
*** 108,111 ****
--- 106,121 ----
  tester("ntpath.normpath('../.././..')", r'..\..\..')
  tester("ntpath.normpath('K:../.././..')", r'K:..\..\..')
+ 
+ # ntpath.abspath() can only be used on a system with the "nt" module
+ # (reasonably), so we protect this test with "import nt".  This allows
+ # the rest of the tests for the ntpath module to be run to completion
+ # on any platform, since most of the module is intended to be usable
+ # from any platform.
+ try:
+     import nt
+ except ImportError:
+     pass
+ else:
+     tester('ntpath.abspath("C:\\")', "C:\\")
  
  if errors: