mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 10:26:02 +00:00 
			
		
		
		
	 ab91fdef1f
			
		
	
	
		ab91fdef1f
		
	
	
	
	
		
			
			svn+ssh://svn.python.org/python/branches/py3k ........ r73715 | benjamin.peterson | 2009-07-01 01:06:06 +0200 (Mi, 01 Jul 2009) | 1 line convert old fail* assertions to assert* ........
		
			
				
	
	
		
			31 lines
		
	
	
	
		
			760 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
	
		
			760 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from importlib import _bootstrap
 | |
| from . import util
 | |
| 
 | |
| import collections
 | |
| import imp
 | |
| import sys
 | |
| import unittest
 | |
| 
 | |
| 
 | |
| class PathHookTests(unittest.TestCase):
 | |
| 
 | |
|     """Test the path hook for extension modules."""
 | |
|     # XXX Should it only succeed for pre-existing directories?
 | |
|     # XXX Should it only work for directories containing an extension module?
 | |
| 
 | |
|     def hook(self, entry):
 | |
|         return _bootstrap._ExtensionFileFinder(entry)
 | |
| 
 | |
|     def test_success(self):
 | |
|         # Path hook should handle a directory where a known extension module
 | |
|         # exists.
 | |
|         self.assertTrue(hasattr(self.hook(util.PATH), 'find_module'))
 | |
| 
 | |
| 
 | |
| def test_main():
 | |
|     from test.support import run_unittest
 | |
|     run_unittest(PathHookTests)
 | |
| 
 | |
| 
 | |
| if __name__ == '__main__':
 | |
|     test_main()
 |