opencobra / memote

memote – the genome-scale metabolic model test suite
https://memote.readthedocs.io/
Apache License 2.0
125 stars 26 forks source link

Test for biomass SBO term checks for presence rather than presence #600

Closed gregmedlock closed 5 years ago

gregmedlock commented 5 years ago

Problem description

The test for the biomass SBO term on biomass reactions fails when the term is actually present because test_biomass_specific_sbo_presence in test_sbo.py is checking for presence of terms, but the search for specific SBO terms only returns an element if the element is missing the term.

Specifically, this line returns ids of elements that are missing the SBO term:

ann["data"] = get_ids(sbo.check_component_for_specific_sbo_term( biomass, "SBO:0000629"))

But the assert statement at the end of the test is expecting ann["data] to be of the same length as the number of biomass reactions; I think this should be 0 instead:

assert len(ann["data"]) == len(biomass), ann["message"]

I can create a PR for this and updated unit tests soon. The change is small, so might be worth doing before resolving #469

System Information ================== OS Linux OS-release 4.4.0-140-generic Python 3.5.2 Package Versions ================ Jinja2 2.10 click 6.7 click-configfile 0.2.3 click-log 0.3.2 cobra 0.13.3 cookiecutter 1.6.0 depinfo 1.4.0 equilibrator_api 0.1.26 future 0.16.0 gitpython 2.1.11 goodtables 1.0.0 importlib_resources 1.0.2 memote 0.8.11 numpydoc 0.8.0 pandas 0.23.4 pip 18.1 pygithub 1.43.4 pylru 1.1.0 pytest 3.7.2 python-libsbml 5.17.0 requests 2.19.1 ruamel.yaml 0.14.12 setuptools 40.6.3 six 1.11.0 sqlalchemy 1.3.0b1 sympy 1.2 travis-encrypt 1.1.2 travispy 0.3.5 wheel 0.32.3
Midnighter commented 5 years ago

Please go ahead :+1: