Skip to content

Commit

Permalink
Add flux span ednpoint test
Browse files Browse the repository at this point in the history
  • Loading branch information
kkaris committed Jul 13, 2023
1 parent a326139 commit d41c558
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_model_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,3 +650,20 @@ def test_counts_to_dimensionless_amr(self):

for initial in tm_dimless.initials.values():
assert initial.concept.units.expression.args[0].equals(1)

def test_flux_span_endpoint(self):
# Load test file
from mira.sources.askenet.flux_span import test_file_path
flux_span = json.load(test_file_path.open())
response = self.client.post(
"/api/flux_span",
json={"flux_span": flux_span}
)
self.assertEqual(200, response.status_code)

flux_span_tm_json = response.json()
flux_span_tm = TemplateModel.from_json(flux_span_tm_json)
assert len(flux_span_tm.templates) == 10
assert len(flux_span_tm.parameters) == 4
assert all(t.rate_law for t in flux_span_tm.templates)

0 comments on commit d41c558

Please sign in to comment.