Skip to content

Commit 5cc1038

Browse files
committed
Test extracting just a file
1 parent 026b939 commit 5cc1038

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/framework/filetools.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2624,7 +2624,12 @@ def test_extract_file(self):
26242624
self.assertTrue(os.path.samefile(path, toy_path))
26252625
path = ft.extract_file(bar_tarball, extraction_path, change_into_dir=False)
26262626
self.assertTrue(os.path.samefile(path, os.path.join(extraction_path, 'bar-0.0')))
2627-
# Contains no folder
2627+
2628+
# Contains just a file
2629+
path = ft.extract_file(file_tarball, extraction_path, change_into_dir=False)
2630+
self.assertTrue(os.path.samefile(path, extraction_path))
2631+
# Same behavior when only a file is extracted
2632+
ft.remove_dir(extraction_path)
26282633
path = ft.extract_file(file_tarball, extraction_path, change_into_dir=False)
26292634
self.assertTrue(os.path.samefile(path, extraction_path))
26302635

0 commit comments

Comments
 (0)