File tree 1 file changed +42
-0
lines changed
importlib_resources/tests 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change
1
+ import unittest
2
+ import importlib_resources as resources
3
+
4
+ from . import data01
5
+ from . import util
6
+
7
+
8
+ class ContentsTests :
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
+ assert self .expected <= set (resources .contents (self .data ))
19
+
20
+
21
+ class ContentsDiskTests (ContentsTests , unittest .TestCase ):
22
+ def setUp (self ):
23
+ self .data = data01
24
+
25
+
26
+ class ContentsZipTests (ContentsTests , util .ZipSetup , unittest .TestCase ):
27
+ pass
28
+
29
+
30
+ class ContentsNamespaceTests (ContentsTests , unittest .TestCase ):
31
+ expected = {
32
+ # no __init__ because of namespace design
33
+ # no subdirectory as incidental difference in fixture
34
+ 'binary.file' ,
35
+ 'utf-16.file' ,
36
+ 'utf-8.file' ,
37
+ }
38
+
39
+ def setUp (self ):
40
+ from . import namespacedata01
41
+
42
+ self .data = namespacedata01
You can’t perform that action at this time.
0 commit comments