Skip to content
Snippets Groups Projects
Commit e62921cc authored by Alexander Schlemmer's avatar Alexander Schlemmer
Browse files

ENH: added support for referencing files

parent 5a231f42
No related branches found
No related tags found
1 merge request!53Release 0.1
......@@ -83,3 +83,5 @@ hdf5File:
Measurement:
recommended_properties:
date:
ReadmeFile:
datatype: REFERENCE
......@@ -208,6 +208,30 @@ def test_identifiable_update(clear_database, usemodel, ident, crawler):
assert len(ups) == 0
def test_file_insertion_dry(clear_database, usemodel, ident, crawler_extended):
updateList = crawler_extended.updateList
fileList = [r for r in updateList if r.role == "File"]
assert len(fileList) == 11
for f in fileList:
assert f.path.endswith("README.md")
assert f.path == f.file
ins, ups = crawler_extended.synchronize(commit_changes=False)
assert len(ups) == 0
fileList_ins = [r for r in ins if r.role == "File"]
assert len(fileList_ins) == 11
def test_file_insertion(clear_database, usemodel, ident, crawler_extended):
updateList = cr.updateList
# correct paths for current working directory
updateList = crawler_extended.updateList
fileList = [r for r in updateList if r.role == "File"]
for f in fileList:
f.file = rfp("..", "unittests", "test_directories", "examples_article", f.file)
ins, ups = crawler_extended.synchronize(commit_changes=True)
fileList_ins = [r for r in ins if r.role == "File"]
assert len(fileList_ins) == 11
assert db.execute_query("COUNT File") > 0
......@@ -47,6 +47,8 @@ DataAnalysis: # name of the converter
file: $README # this is automatically the relative path
# starting from the top level structure element
# of this element
Measurement:
ReadmeFile: $ReadmeFile
subtree:
description:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment