Changeset 391 for python/trunk/Lib/test/test_macostools.py
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Lib/test/test_macostools.py
r2 r391 2 2 3 3 import unittest 4 import macostools5 import Carbon.File6 import MacOS7 4 import os 8 5 import sys 9 6 from test import test_support 7 8 MacOS = test_support.import_module('MacOS') 9 #The following modules should exist if MacOS exists. 10 import Carbon.File 11 import macostools 10 12 11 13 TESTFN2 = test_support.TESTFN + '2' … … 22 24 23 25 def tearDown(self): 24 try: 25 os.unlink(test_support.TESTFN) 26 except: 27 pass 28 try: 29 os.unlink(TESTFN2) 30 except: 31 pass 26 test_support.unlink(test_support.TESTFN) 27 test_support.unlink(TESTFN2) 32 28 33 29 def compareData(self): … … 52 48 def test_touched(self): 53 49 # This really only tests that nothing unforeseen happens. 54 import warnings 55 with warnings.catch_warnings(): 56 warnings.filterwarnings('ignore', 'macostools.touched*', 57 DeprecationWarning) 50 with test_support.check_warnings(('macostools.touched*', 51 DeprecationWarning), quiet=True): 58 52 macostools.touched(test_support.TESTFN) 59 53 60 54 if sys.maxint < 2**32: 61 55 def test_copy(self): 62 try: 63 os.unlink(TESTFN2) 64 except: 65 pass 56 test_support.unlink(TESTFN2) 66 57 macostools.copy(test_support.TESTFN, TESTFN2) 67 58 self.assertEqual(self.compareData(), '') … … 69 60 if sys.maxint < 2**32: 70 61 def test_mkalias(self): 71 try: 72 os.unlink(TESTFN2) 73 except: 74 pass 62 test_support.unlink(TESTFN2) 75 63 macostools.mkalias(test_support.TESTFN, TESTFN2) 76 64 fss, _, _ = Carbon.File.ResolveAliasFile(TESTFN2, 0) … … 78 66 79 67 def test_mkalias_relative(self): 80 try: 81 os.unlink(TESTFN2) 82 except: 83 pass 68 test_support.unlink(TESTFN2) 84 69 # If the directory doesn't exist, then chances are this is a new 85 70 # install of Python so don't create it since the user might end up … … 96 81 # Skip on wide unicode 97 82 if len(u'\0'.encode('unicode-internal')) == 4: 98 raise test_support.TestSkipped("test_macostools is broken in USC4")83 raise unittest.SkipTest("test_macostools is broken in USC4") 99 84 test_support.run_unittest(TestMacostools) 100 85
Note:
See TracChangeset
for help on using the changeset viewer.