Skip to content

Commit 6c9b190

Browse files
committed
Change the assertions for test_join_path to assert that the subdirectory is a multiplexed path to avoid touching implementation details.
1 parent b68509f commit 6c9b190

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

importlib_resources/tests/test_reader.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,10 @@ def test_join_path(self):
6868
str(path.joinpath('binary.file'))[len(prefix) + 1 :],
6969
os.path.join('namespacedata01', 'binary.file'),
7070
)
71-
self.assertEqual(
72-
str(path.joinpath('subdirectory')._paths[0])[len(prefix) + 1 :],
73-
os.path.join('namespacedata01', 'subdirectory'),
74-
)
75-
self.assertEqual(
76-
str(path.joinpath('subdirectory')._paths[1])[len(prefix) + 1 :],
77-
os.path.join('data01', 'subdirectory'),
78-
)
71+
sub = path.joinpath('subdirectory')
72+
assert isinstance(sub, MultiplexedPath)
73+
assert 'namespacedata01' in str(sub)
74+
assert 'data01' in str(sub)
7975
self.assertEqual(
8076
str(path.joinpath('imaginary'))[len(prefix) + 1 :],
8177
os.path.join('namespacedata01', 'imaginary'),

0 commit comments

Comments
 (0)