Skip to content

Commit

Permalink
add test for single zip
Browse files Browse the repository at this point in the history
  • Loading branch information
ninsbl committed Oct 1, 2024
1 parent 049d9d9 commit 23b90d9
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/general/g.unzip/testsuite/test_g_unzip.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,22 @@ def test_g_unzip_no_out_dir(self):
len(list((self.tempdir / "testdir").glob("testfile_*.txt"))) == 4
)

def test_g_unzip_single_zip(self):
"""Test unzipping a single zip file"""
# Check that zip-files are created
self.assertTrue(len(list(self.tempdir.glob("testfile_*.zip"))) == 4)
# Check that g.unzip runs successfully
self.assertModule(
"g.unzip",
input=str(self.tempdir / "testfile_1.zip"),
output=str(self.tempdir / "testdir_file"),
verbose=True,
)
# Check that unzipped-files exist in the file system
self.assertFileExists(
str(self.tempdir / "testdir_file" / "testdir" / "testfile_1.txt")
)

def test_g_unzip_empty_dir(self):
"""Test unzipping if input directory is empty (should not fail)"""
# Check that zip-files are created
Expand Down

0 comments on commit 23b90d9

Please sign in to comment.