Skip to content

Commit

Permalink
Added test, to detect bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
niekdejonge committed Aug 7, 2024
1 parent fe1ac2b commit ffe805d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test_add_classifier_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,10 @@ def test_add_classifier_annotation(spectra):
result = select_compound_classes(spectra)
assert sorted(result) == [['WRIPSIKIDAUKBP', 'Organic compounds', 'Phenylpropanoids and polyketides', 'Macrolactams', '', 'Macrolactams', '', '', 'Alkaloids', 'False'],
['WXDBUBIFYCCNLE', 'Organic compounds', 'Organoheterocyclic compounds', 'Oxepanes', '', 'Oxepanes', 'Lipopeptides', 'Oligopeptides', 'Amino acids and Peptides', 'False']]


def test_add_classifier_annotation_unknown_inchikey(spectra):
"""This tests that when no compound class annotation is found, that it is correctly filled with empty strings"""
spectra[1].set("inchikey", "AAAAAAAAAAAAAA")
result = select_compound_classes(spectra)
assert len(result[0]) == len(result[1])

0 comments on commit ffe805d

Please sign in to comment.