(root)/
Python-3.11.7/
Lib/
test/
test_importlib/
test_contents.py
       1  import unittest
       2  from importlib import resources
       3  
       4  from . import data01
       5  from .resources import util
       6  
       7  
       8  class ESC[4;38;5;81mContentsTests:
       9      expected = {
      10          '__init__.py',
      11          'binary.file',
      12          'subdirectory',
      13          'utf-16.file',
      14          'utf-8.file',
      15      }
      16  
      17      def test_contents(self):
      18          contents = {path.name for path in resources.files(self.data).iterdir()}
      19          assert self.expected <= contents
      20  
      21  
      22  class ESC[4;38;5;81mContentsDiskTests(ESC[4;38;5;149mContentsTests, ESC[4;38;5;149munittestESC[4;38;5;149m.ESC[4;38;5;149mTestCase):
      23      def setUp(self):
      24          self.data = data01
      25  
      26  
      27  class ESC[4;38;5;81mContentsZipTests(ESC[4;38;5;149mContentsTests, ESC[4;38;5;149mutilESC[4;38;5;149m.ESC[4;38;5;149mZipSetup, ESC[4;38;5;149munittestESC[4;38;5;149m.ESC[4;38;5;149mTestCase):
      28      pass
      29  
      30  
      31  class ESC[4;38;5;81mContentsNamespaceTests(ESC[4;38;5;149mContentsTests, ESC[4;38;5;149munittestESC[4;38;5;149m.ESC[4;38;5;149mTestCase):
      32      expected = {
      33          # no __init__ because of namespace design
      34          # no subdirectory as incidental difference in fixture
      35          'binary.file',
      36          'utf-16.file',
      37          'utf-8.file',
      38      }
      39  
      40      def setUp(self):
      41          from . import namespacedata01
      42  
      43          self.data = namespacedata01