Skip to content

Commit

Permalink
Add test for plot_metabolic_models
Browse files Browse the repository at this point in the history
  • Loading branch information
guillecg committed Sep 14, 2023
1 parent 03eadb5 commit 5cbc0c5
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion tests/test_gem.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@

import pytest

import pandas as pd

import plotly

from biofoundry.gem import (
get_gene_counts,
ModelValidator,
ModelBuilder
ModelBuilder,
plot_metabolic_models
)


Expand Down Expand Up @@ -138,3 +143,25 @@ def test_rename_metabolites(

assert model_text == model_text_expected, \
"Metabolites are not correctly renamed!"


def test_plot_metabolic_models(config: dict) -> None:

# Use expected model JSON file
config["paths"]["models"] = os.path.join(
config["paths"]["models"],
"expected"
)

metadata_df = pd.DataFrame({
"Organism": ["organism"],
"Genes (annotation)": [2]
})

fig = plot_metabolic_models(
metadata_df=metadata_df,
config=config
)

assert type(fig) == plotly.graph_objects.Figure, \
"Plot was not correctly generated"

0 comments on commit 5cbc0c5

Please sign in to comment.