Skip to content

Commit

Permalink
Remove tests for filepath_files validation
Browse files Browse the repository at this point in the history
  • Loading branch information
GeigerJ2 committed Oct 2, 2024
1 parent 1ac66a4 commit 76c0d86
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions tests/orm/data/code/test_portable.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,35 +84,6 @@ def test_filepath_executable(tmp_path):
code.filepath_executable = filepath_executable


def test_filepath_files(tmp_path):
"""Test the :meth:`aiida.orm.nodes.data.code.portable.PortableCode.filepath_files` property."""
filepath_files = tmp_path / 'code-dir'
filepath_executable = 'bash'

# Check existance fo `filepath_files`
with pytest.raises(ValueError, match=r'`filepath_files` must be an existing directory.'):
code = PortableCode(filepath_executable=filepath_executable, filepath_files=filepath_files)

filepath_files.mkdir(parents=True, exist_ok=True)
(filepath_files / filepath_executable).touch()

code = PortableCode(filepath_executable=filepath_executable, filepath_files=filepath_files)

# Check if absolute path
with pytest.raises(ValueError, match=r'`filepath_files` must be an absolute path.'):
code.filepath_files = 'rel_path'

# Check that `NodeRepository` is cleaned up when setting new `filepath_files`
code.base.repository.put_object_from_filelike(io.BytesIO(b''), 'test-erase')
code.filepath_files = filepath_files
assert 'test-erase' not in code.base.repository.list_object_names()

# Check that `filepath_files` immutable after being stored
code.store()
with pytest.raises(ModificationNotAllowed):
code.filepath_files = filepath_files


def test_full_label(tmp_path):
"""Test the :meth:`aiida.orm.nodes.data.code.portable.PortableCode.full_label` property."""
label = 'some-label'
Expand Down

0 comments on commit 76c0d86

Please sign in to comment.