mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	* gh-116608: Apply style and compatibility changes from importlib_metadata. * gh-121735: Ensure module-adjacent resources are loadable from a zipfile. * gh-121735: Allow all modules to be processed by the ZipReader. * Add blurb * Remove update-zips script, unneeded. * Remove unnecessary references to removed static fixtures. * Remove zipdata fixtures, unused.
		
			
				
	
	
		
			38 lines
		
	
	
	
		
			829 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			38 lines
		
	
	
	
		
			829 B
		
	
	
	
		
			Python
		
	
	
	
	
	
import unittest
 | 
						|
from importlib import resources
 | 
						|
 | 
						|
from . import util
 | 
						|
 | 
						|
 | 
						|
class ContentsTests:
 | 
						|
    expected = {
 | 
						|
        '__init__.py',
 | 
						|
        'binary.file',
 | 
						|
        'subdirectory',
 | 
						|
        'utf-16.file',
 | 
						|
        'utf-8.file',
 | 
						|
    }
 | 
						|
 | 
						|
    def test_contents(self):
 | 
						|
        contents = {path.name for path in resources.files(self.data).iterdir()}
 | 
						|
        assert self.expected <= contents
 | 
						|
 | 
						|
 | 
						|
class ContentsDiskTests(ContentsTests, util.DiskSetup, unittest.TestCase):
 | 
						|
    pass
 | 
						|
 | 
						|
 | 
						|
class ContentsZipTests(ContentsTests, util.ZipSetup, unittest.TestCase):
 | 
						|
    pass
 | 
						|
 | 
						|
 | 
						|
class ContentsNamespaceTests(ContentsTests, util.DiskSetup, unittest.TestCase):
 | 
						|
    MODULE = 'namespacedata01'
 | 
						|
 | 
						|
    expected = {
 | 
						|
        # no __init__ because of namespace design
 | 
						|
        'binary.file',
 | 
						|
        'subdirectory',
 | 
						|
        'utf-16.file',
 | 
						|
        'utf-8.file',
 | 
						|
    }
 |