Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Tianhao-Gu committed Jan 17, 2024
1 parent 34997ae commit ff3b027
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/AssemblyUtil/FastaToAssembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,9 +484,9 @@ def _validate_mass_params(self, params):

# validate object_metadata is a mapping if provided
obj_metas = [i.get(_OBJ_META) for i in inputs]
for obj_meta in obj_metas:
for i, obj_meta in enumerate(obj_metas, start=1):
if obj_meta is not None and type(obj_meta) != dict:
raise ValueError(f"{_OBJ_META} must be a mapping if provided")
raise ValueError(f"{_OBJ_META} must be a mapping if provided for entry #{i}")

def _get_int(self, putative_int, name, minimum=1):
if putative_int is not None:
Expand Down
4 changes: 3 additions & 1 deletion test/FastaToAssembly_unit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,10 +640,12 @@ def test_import_fasta_mass_fail_min_contig_length():


def test_import_fasta_mass_fail_invalid_obj_meta():
err1 = 'object_metadata must be a mapping if provided'
err1 = 'object_metadata must be a mapping if provided for entry #1'
test_spec = [
(err1,
{'workspace_id': 3, 'inputs': [{'node': 'a', 'assembly_name': 'x', 'object_metadata': 'foo'}]}),
(err1,
{'workspace_id': 3, 'inputs': [{'node': 'a', 'assembly_name': 'x', 'object_metadata': []}]})
]
_run_test_spec_fail(test_spec, mass=True)

Expand Down

0 comments on commit ff3b027

Please sign in to comment.