Skip to content

Commit

Permalink
chore: sped up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrkarr committed Aug 17, 2021
1 parent 763ab49 commit b50e135
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions tests/test_core_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ def test_exec_sed_task(self):
),
simulation=sedml_data_model.UniformTimeCourseSimulation(
algorithm=sedml_data_model.Algorithm(
kisao_id='KISAO_0000029',
kisao_id='KISAO_0000088',
changes=[
sedml_data_model.AlgorithmParameterChange(
kisao_id='KISAO_0000488',
new_value='10',
kisao_id='KISAO_0000211',
new_value='1e-10',
),
],
),
Expand Down Expand Up @@ -210,6 +210,9 @@ def test_exec_sed_task_errors(self):
),
]

task.simulation.algorithm.kisao_id = 'KISAO_0000088'
task.simulation.algorithm.changes[0].kisao_id = 'KISAO_0000211'
task.simulation.algorithm.changes[0].new_value = '1e-10'
variable_results, _ = core.exec_sed_task(task, variables, TaskLog())

self.assertTrue(sorted(variable_results.keys()), sorted([var.id for var in variables]))
Expand All @@ -228,11 +231,11 @@ def test_exec_sed_task_errors(self):
),
simulation=sedml_data_model.UniformTimeCourseSimulation(
algorithm=sedml_data_model.Algorithm(
kisao_id='KISAO_0000029',
kisao_id='KISAO_0000088',
changes=[
sedml_data_model.AlgorithmParameterChange(
kisao_id='KISAO_0000488',
new_value='10',
kisao_id='KISAO_0000211',
new_value='1e-10',
),
],
),
Expand Down Expand Up @@ -282,13 +285,19 @@ def test_exec_sedml_docs_in_combine_archive_with_all_algorithms(self):
alg_props = KISAO_ALGORITHM_MAP[alg.kisao_id]
alg.changes = []
for param_kisao_id, param_props in alg_props.parameters.items():
new_value = param_props.default

if param_kisao_id == 'KISAO_0000488':
new_value = '1'
else:
new_value = param_props.default

if isinstance(new_value, enum.Enum):
new_value = new_value.value
if new_value is None:
new_value = ''
else:
new_value = str(new_value)

alg.changes.append(sedml_data_model.AlgorithmParameterChange(
kisao_id=param_kisao_id,
new_value=new_value,
Expand Down Expand Up @@ -360,11 +369,11 @@ def _build_combine_archive(self, algorithm=None):
def _build_sed_doc(self, algorithm=None):
if algorithm is None:
algorithm = sedml_data_model.Algorithm(
kisao_id='KISAO_0000029',
kisao_id='KISAO_0000088',
changes=[
sedml_data_model.AlgorithmParameterChange(
kisao_id='KISAO_0000488',
new_value='10',
kisao_id='KISAO_0000211',
new_value='1e-10',
),
],
)
Expand Down

0 comments on commit b50e135

Please sign in to comment.