Skip to content
Snippets Groups Projects
Commit 41c10bc7 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[test][algorithms][integers_rawdata_access] Make path to db data a parameter

This will allow to reuse the algorithm with
different databases.
parent 8ac5ad4b
No related branches found
No related tags found
1 merge request!28Add protocoltemplates
......@@ -18,5 +18,11 @@
],
"uses": {
"lib": "{{ user.username }}/thelib/1"
}
},
"parameters": {
"base_path": {
"default": "",
"type": "string"
}
}
}
......@@ -31,7 +31,8 @@ class Algorithm:
self.offset = 1
def setup(self, parameters):
with open("/databases/simple_rawdata_access/1/datafile.txt", "rt") as shared_data:
base_path = parameters["base_path"]
with open(f"/databases/{base_path}/datafile.txt", "rt") as shared_data:
value = shared_data.read()
self.offset = int(value)
return True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment