Skip to content

Commit fd31de9

Browse files
committed
chore: added tests for model changes, bumped version
1 parent 18fb39e commit fd31de9

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# Base OS
1515
FROM python:3.9-slim-buster
1616

17-
ARG VERSION="0.1.19"
17+
ARG VERSION="0.1.20"
1818
ARG SIMULATOR_VERSION="2.2.0"
1919

2020
# metadata

biosimulators_tellurium/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.1.19'
1+
__version__ = '0.1.20'

tests/test_core_main.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,7 @@ def test_exec_sed_task_with_preprocesssed_task(self):
525525
mid_c = preprocessed_task.road_runner['C']
526526
mid_m = preprocessed_task.road_runner['M']
527527
mid_x = preprocessed_task.road_runner['X']
528+
self.assertIsInstance(mid_c, float)
528529

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

566+
# check changes can be strings
567+
task.model.changes = [
568+
sedml_data_model.ModelAttributeChange(
569+
target="/sbml:sbml/sbml:model/sbml:listOfSpecies/sbml:species[@id='C']",
570+
target_namespaces=self.NAMESPACES,
571+
new_value=str(mid_c),
572+
),
573+
sedml_data_model.ModelAttributeChange(
574+
target="/sbml:sbml/sbml:model/sbml:listOfSpecies/sbml:species[@id='M']",
575+
target_namespaces=self.NAMESPACES,
576+
new_value=str(mid_m),
577+
),
578+
sedml_data_model.ModelAttributeChange(
579+
target="/sbml:sbml/sbml:model/sbml:listOfSpecies/sbml:species[@id='X']",
580+
target_namespaces=self.NAMESPACES,
581+
new_value=str(mid_x),
582+
),
583+
]
584+
variable_results, log = core.exec_sed_task(task, variables, preprocessed_task=preprocessed_task)
585+
numpy.testing.assert_allclose(variable_results['C'][-1], end_c)
586+
565587
def test_exec_sedml_docs_in_combine_archive_successfully_with_biosimulators(self):
566588
doc, archive_filename = self._build_combine_archive()
567589

0 commit comments

Comments
 (0)