Skip to content
Snippets Groups Projects
Commit 4f55cf04 authored by Megan Henning's avatar Megan Henning
Browse files

Add tests

parent 72bd5e40
No related branches found
No related tags found
No related merge requests found
......@@ -93,7 +93,7 @@ def eval_match(match_type, match_param, file_, container):
elif match_type == 'container.has-type':
for c_file in container['files']:
c_file_type = c_file.get('type')
if c_file_type and match_param.lower() == c_file_type.lower()
if c_file_type and match_param.lower() == c_file_type.lower():
return True
return False
......
......@@ -376,6 +376,11 @@ def test_rules(randstr, data_builder, file_form, as_root, as_admin, with_user, a
)
assert r.ok
# Ensure file without type or measurements does not cause issues with rule evalution
# upload file that matches only part of rule
r = as_admin.post('/projects/' + project + '/files', files=file_form('test3.notreal'))
assert r.ok
# test that only one job was created via rule
gear_jobs = [job for job in api_db.jobs.find({'gear_id': gear_2})]
assert len(gear_jobs) == 2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment