Skip to content

Commit

Permalink
Merge pull request #26 from broeder-j/implement_feature_issue_25
Browse files Browse the repository at this point in the history
allowed for expressions in ingnore file lists, implements issue #25, …
  • Loading branch information
greschd committed Feb 27, 2020
2 parents 5541e9e + 6d6f594 commit ecbaa7e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion aiida_testing/mock_code/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import hashlib
import subprocess
import typing as ty
import fnmatch

from ._env_keys import EnvKeys

Expand Down Expand Up @@ -51,7 +52,7 @@ def run() -> None:
continue
os.makedirs(os.path.join(res_dir, dirname), exist_ok=True)
for filename in filenames:
if filename in ignore_files:
if any(fnmatch.fnmatch(filename, expr) for expr in ignore_files):
continue
file_path = os.path.join(dirname, filename)
res_file_path = os.path.join(res_dir, file_path)
Expand Down
4 changes: 2 additions & 2 deletions tests/mock_code/test_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def test_basic(mock_code_factory, generate_diff_inputs): # pylint: disable=rede
label='diff',
data_dir_abspath=os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data'),
entry_point=CALC_ENTRY_POINT,
ignore_files=('_aiidasubmit.sh', 'file1.txt', 'file2.txt')
ignore_files=('_aiidasubmit.sh', 'file*')
)

res, node = run_get_node(
Expand Down Expand Up @@ -106,7 +106,7 @@ def test_broken_code(mock_code_factory, generate_diff_inputs): # pylint: disabl
label='diff-broken',
data_dir_abspath=os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data'),
entry_point=CALC_ENTRY_POINT,
ignore_files=('_aiidasubmit.sh', 'file1.txt', 'file2.txt')
ignore_files=('_aiidasubmit.sh', 'file?.txt')
)

res, node = run_get_node(
Expand Down

0 comments on commit ecbaa7e

Please sign in to comment.