Skip to content

Commit

Permalink
bugfix test tmp dir
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasprobst committed Jun 25, 2024
1 parent c42900f commit eb79f01
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def test_hash(self):
self.assertEqual(h5tbx.get_checksum(h5.hdf_filename),
'6781e0baec8d65b9a95a3e879a5098d1')


def test_touch_tmp_hdf5_file(self):
with h5tbx.set_config(auto_create_h5tbx_version=False):
now = datetime.datetime.now()
Expand Down Expand Up @@ -50,8 +49,12 @@ def test_generate_temporary_filename(self):
self.assertEqual(f_predict, fnew)

def test_generate_temporary_directory(self):
import shutil
from h5rdmtoolbox._user import _dircounter

shutil.rmtree(str(h5tbx._user.UserDir['tmp']))
n = next(_dircounter)+1
testfolder = h5tbx.utils.generate_temporary_directory(prefix='testfolder')
n = int(testfolder.stem[-1])
folder = h5tbx._user.UserDir['tmp'] / f'testfolder{n + 1}'
folder.mkdir()
testfolder = h5tbx.utils.generate_temporary_directory(prefix='testfolder')
Expand Down

0 comments on commit eb79f01

Please sign in to comment.