[pywin32-checkins] pywin32/win32/test test_win32api.py,1.9,1.10
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2006-06-21 12:07:24
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7706 Modified Files: test_win32api.py Log Message: Test short unicode names. Index: test_win32api.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32api.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** test_win32api.py 15 Mar 2006 04:00:08 -0000 1.9 --- test_win32api.py 21 Jun 2006 12:07:21 -0000 1.10 *************** *** 95,98 **** --- 95,116 ---- "Expected long name ('%s') to be original name ('%s')" % (long_name, fname)) + def testShortUnicodeNames(self): + try: + me = __file__ + except NameError: + me = sys.argv[0] + fname = os.path.abspath(me) + # passing unicode should cause GetShortPathNameW to be called. + short_name = win32api.GetShortPathName(unicode(fname)) + self.failUnless(isinstance(short_name, unicode)) + long_name = win32api.GetLongPathName(short_name) + self.failUnless(long_name==fname, \ + "Expected long name ('%s') to be original name ('%s')" % (long_name, fname)) + self.failUnlessEqual(long_name, win32api.GetLongPathNameW(short_name)) + long_name = win32api.GetLongPathNameW(short_name) + self.failUnless(type(long_name)==unicode, "GetLongPathNameW returned type '%s'" % (type(long_name),)) + self.failUnless(long_name==fname, \ + "Expected long name ('%s') to be original name ('%s')" % (long_name, fname)) + def testLongLongPathNames(self): # We need filename where the FQN is > 256 - simplest way is to create a |