Skip to content
Snippets Groups Projects
Commit 2a47d155 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

FIX: simple use case int test

parent f9ae5c03
Branches
Tags
2 merge requests!105REL: v0.4.0,!101ENH: add the 'add_prefix' argument
Pipeline #33841 passed
......@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- the restricted_path argument allows to crawl only a subtree
- You can now access the file system path of a structure element (if it has one) using the variable
name "<converter name>\_path"
- added the arguments 'add-prefix' and 'remove-prefix' to the command line and `crawler_main`
### Changed ###
......
......@@ -68,8 +68,8 @@ extroot:
parents:
- mdfile
role: File
path: $DataFile
file: $DataFile
path: $DataFile_path
file: $DataFile_path
Experiment: {}
......
......@@ -63,7 +63,7 @@ def test_complete_crawler(
True,
os.path.join(DATADIR, "provenance.yml"),
False,
remove_prefix="/use_case_simple_presentation")
remove_prefix=os.path.abspath(DATADIR))
res = db.execute_query("FIND Record Experiment")
assert len(res) == 1
......
......@@ -1308,7 +1308,8 @@ def crawler_main(crawled_directory_path: str,
elem.path = elem.path[len(remove_prefix):]
else:
raise RuntimeError("Prefix shall be removed from file path but the path "
"does not start with the prefix")
"does not start with the prefix:"
f"\n{remove_prefix}\n{elem.path}")
if add_prefix:
elem.path = add_prefix + elem.path
elem.file = None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment