Skip to content

Commit

Permalink
chore: added tests for model changes, bumped version
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrkarr committed Sep 11, 2021
1 parent 18fb39e commit fd31de9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# Base OS
FROM python:3.9-slim-buster

ARG VERSION="0.1.19"
ARG VERSION="0.1.20"
ARG SIMULATOR_VERSION="2.2.0"

# metadata
Expand Down
2 changes: 1 addition & 1 deletion biosimulators_tellurium/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.1.19'
__version__ = '0.1.20'
22 changes: 22 additions & 0 deletions tests/test_core_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ def test_exec_sed_task_with_preprocesssed_task(self):
mid_c = preprocessed_task.road_runner['C']
mid_m = preprocessed_task.road_runner['M']
mid_x = preprocessed_task.road_runner['X']
self.assertIsInstance(mid_c, float)

variable_results, log = core.exec_sed_task(task, variables, preprocessed_task=preprocessed_task)
numpy.testing.assert_allclose(variable_results['C'][-1], end_c)
Expand Down Expand Up @@ -562,6 +563,27 @@ def test_exec_sed_task_with_preprocesssed_task(self):
task.simulation.number_of_points + 1,
))

# check changes can be strings
task.model.changes = [
sedml_data_model.ModelAttributeChange(
target="/sbml:sbml/sbml:model/sbml:listOfSpecies/sbml:species[@id='C']",
target_namespaces=self.NAMESPACES,
new_value=str(mid_c),
),
sedml_data_model.ModelAttributeChange(
target="/sbml:sbml/sbml:model/sbml:listOfSpecies/sbml:species[@id='M']",
target_namespaces=self.NAMESPACES,
new_value=str(mid_m),
),
sedml_data_model.ModelAttributeChange(
target="/sbml:sbml/sbml:model/sbml:listOfSpecies/sbml:species[@id='X']",
target_namespaces=self.NAMESPACES,
new_value=str(mid_x),
),
]
variable_results, log = core.exec_sed_task(task, variables, preprocessed_task=preprocessed_task)
numpy.testing.assert_allclose(variable_results['C'][-1], end_c)

def test_exec_sedml_docs_in_combine_archive_successfully_with_biosimulators(self):
doc, archive_filename = self._build_combine_archive()

Expand Down

0 comments on commit fd31de9

Please sign in to comment.