Skip to content

Commit

Permalink
Merge 530a0c3 into 8d07941
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinos Kousidis committed Dec 3, 2018
2 parents 8d07941 + 530a0c3 commit ec054f4
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions pytest_reana/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,12 +450,22 @@ def sample_workflow_workspace(tmp_shared_volume_path):
the ``tests/test_workspace`` directory.
"""
test_workspace_path = pkg_resources.resource_filename(
'pytest_reana',
'test_workspace')
return shutil.copytree(test_workspace_path,
os.path.join(tmp_shared_volume_path,
'test_workspace'))
def _create_sample_workflow_workspace(workflow_id):
test_workspace_path = pkg_resources.resource_filename(
'pytest_reana',
'test_workspace')
sample_workspace_path = os.path.join(tmp_shared_volume_path,
str(workflow_id))
if not os.path.exists(sample_workspace_path):
shutil.copytree(test_workspace_path,
sample_workspace_path)
yield sample_workspace_path
shutil.rmtree(test_workspace_path,
sample_workspace_path)
else:
yield sample_workspace_path

return _create_sample_workflow_workspace


@pytest.fixture()
Expand Down

0 comments on commit ec054f4

Please sign in to comment.