Skip to content

Commit

Permalink
BF: use correct variable
Browse files Browse the repository at this point in the history
bug likely introduced during refactoring in a62fe7d

Closes #1481
  • Loading branch information
yarikoptic committed Aug 12, 2024
1 parent 5faa18a commit 4625d82
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dandi/metadata/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ def extract_species(metadata: dict) -> models.SpeciesType | None:
break
if value_id is None:
raise ValueError(
f"Cannot interpret species field: {value}. Please "
f"Cannot interpret species field: {value_orig}. Please "
"contact [email protected] to add your species. "
"You can also put the entire url from NCBITaxon "
"(http://www.ontobee.org/ontology/NCBITaxon) into "
Expand Down
6 changes: 6 additions & 0 deletions dandi/tests/test_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,12 @@ def test_species():
}


def test_extract_unknown_species():
with pytest.raises(ValueError) as excinfo:
extract_species({"species": "mumba-jumba"})
assert str(excinfo.value).startswith("Cannot interpret")


def test_species_map():
# all alternative names should be lower case
for common_names, *_ in species_map:
Expand Down

0 comments on commit 4625d82

Please sign in to comment.