mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	Test aliases too.
This commit is contained in:
		
							parent
							
								
									2b88dec606
								
							
						
					
					
						commit
						addc5859db
					
				
					 1 changed files with 20 additions and 1 deletions
				
			
		| 
						 | 
					@ -2,9 +2,10 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import unittest
 | 
					import unittest
 | 
				
			||||||
import macostools
 | 
					import macostools
 | 
				
			||||||
 | 
					import macfs
 | 
				
			||||||
import MacOS
 | 
					import MacOS
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
import tempfile
 | 
					import sys
 | 
				
			||||||
from test import test_support
 | 
					from test import test_support
 | 
				
			||||||
 | 
					
 | 
				
			||||||
TESTFN2 = test_support.TESTFN + '2'
 | 
					TESTFN2 = test_support.TESTFN + '2'
 | 
				
			||||||
| 
						 | 
					@ -60,6 +61,24 @@ def test_copy(self):
 | 
				
			||||||
        macostools.copy(test_support.TESTFN, TESTFN2)
 | 
					        macostools.copy(test_support.TESTFN, TESTFN2)
 | 
				
			||||||
        self.assertEqual(self.compareData(), '')
 | 
					        self.assertEqual(self.compareData(), '')
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
 | 
					    def test_mkalias(self):
 | 
				
			||||||
 | 
					        try:
 | 
				
			||||||
 | 
					            os.unlink(TESTFN2)
 | 
				
			||||||
 | 
					        except:
 | 
				
			||||||
 | 
					            pass
 | 
				
			||||||
 | 
					        macostools.mkalias(test_support.TESTFN, TESTFN2)
 | 
				
			||||||
 | 
					        fss, _, _ = macfs.ResolveAliasFile(TESTFN2)
 | 
				
			||||||
 | 
					        self.assertEqual(fss.as_pathname(), os.path.abspath(test_support.TESTFN))
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					    def test_mkalias_relative(self):
 | 
				
			||||||
 | 
					        try:
 | 
				
			||||||
 | 
					            os.unlink(TESTFN2)
 | 
				
			||||||
 | 
					        except:
 | 
				
			||||||
 | 
					            pass
 | 
				
			||||||
 | 
					        macostools.mkalias(test_support.TESTFN, TESTFN2, sys.prefix)
 | 
				
			||||||
 | 
					        fss, _, _ = macfs.ResolveAliasFile(TESTFN2)
 | 
				
			||||||
 | 
					        self.assertEqual(fss.as_pathname(), os.path.abspath(test_support.TESTFN))
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
def test_main():
 | 
					def test_main():
 | 
				
			||||||
    test_support.run_unittest(TestMacostools)
 | 
					    test_support.run_unittest(TestMacostools)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue