Skip to content

Commit

Permalink
add test for codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
kkappler committed Dec 9, 2023
1 parent 78cd366 commit 6484d96
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/helpers/test_initialize_mth5.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,33 @@ def tearDownClass(self):
self.wd.joinpath("test.h5").unlink()



class TestCompression(unittest.TestCase):
@classmethod
def setUpClass(self):
self.wd = Path().cwd()


def test_has_open_file(self):
self.m = initialize_mth5(self.wd.joinpath("test.h5"), "w")
self.assertIsInstance(self.m, MTH5)

def test_validate_compression(self):
""" COMPRESSION = ["lzf", "gzip", "szip", None]"""
from mth5.helpers import COMPRESSION
from mth5.helpers import COMPRESSION_LEVELS
for compression_type in COMPRESSION:
for compression_level in COMPRESSION_LEVELS[compression_type]:
self.m = MTH5(compression=compression_type, compression_opts=compression_level)
self.m.open_mth5(self.wd.joinpath("test.h5"), mode="a")
self.m = initialize_mth5(self.wd.joinpath("test.h5"), "w")
self.assertIsInstance(self.m, MTH5)
self.m.close_mth5()

@classmethod
def tearDownClass(self):
close_open_files()
self.wd.joinpath("test.h5").unlink()
# =============================================================================
# Run
# =============================================================================
Expand Down

0 comments on commit 6484d96

Please sign in to comment.