Skip to content
Snippets Groups Projects
Commit fcddbe7e authored by Alexander Schlemmer's avatar Alexander Schlemmer
Browse files

TST: made test_zipfile_minimal more general

parent 9103d699
No related branches found
No related tags found
2 merge requests!217TST: Make NamedTemporaryFiles Windows-compatible,!215Fix issues in rocrate support
Pipeline #60822 failed
......@@ -97,15 +97,26 @@ match: .*$
children = zip_conv.create_children(GeneralStore(), zipfile)
assert len(children) == 2
assert children[1].name == "empty.txt"
file_obj = None
dir_obj = None
for ch in children:
if isinstance(ch, File):
file_obj = ch
elif isinstance(ch, Directory):
dir_obj = ch
else:
assert False
assert file_obj is not None and dir_obj is not None
assert file_obj.name == "empty.txt"
dir_conv = DirectoryConverter(yaml.safe_load("""
type: Directory
match: ^folder$
"""), "TestDirectory", converter_registry)
match = dir_conv.match(children[0])
match = dir_conv.match(dir_obj)
assert match is not None
children = dir_conv.create_children(GeneralStore(), children[0])
children = dir_conv.create_children(GeneralStore(), dir_obj)
assert len(children) == 3
for i in range(3):
assert isinstance(children[i], File)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment