diff --git a/bionetgen/modelapi/bngfile.py b/bionetgen/modelapi/bngfile.py index 0d640052..15320c16 100644 --- a/bionetgen/modelapi/bngfile.py +++ b/bionetgen/modelapi/bngfile.py @@ -84,11 +84,9 @@ def generate_xml(self, xml_file, model_file=None) -> bool: xml_file, stripped_bngl ) # no need to chdir here, handled by finally block - app_stdout = conf.get("stdout") - app_suppress = False if app_stdout == "STDOUT" else self.suppress rc, _ = run_command( ["perl", self.bngexec, "--xml", stripped_bngl], - suppress=app_suppress, + suppress=self.suppress, cwd=temp_folder, ) if rc != 0: diff --git a/tests/test_csimulator.py b/tests/test_csimulator.py index 58e9ff7b..18fa63d6 100644 --- a/tests/test_csimulator.py +++ b/tests/test_csimulator.py @@ -189,8 +189,10 @@ def test_csimulator_init_str(): with unittest.mock.patch( "bionetgen.simulator.csimulator._new_ccompiler" ) as mock_new_comp: - with unittest.mock.patch("bionetgen.simulator.csimulator.conf") as mock_conf: - mock_conf.get.return_value = "dummy" + with unittest.mock.patch( + "bionetgen.simulator.csimulator.get_conf" + ) as mock_conf: + mock_conf.return_value = {"cvode_include": "dummy", "cvode_lib": "dummy"} with unittest.mock.patch( "bionetgen.simulator.csimulator.bionetgen.run" @@ -222,8 +224,10 @@ def test_csimulator_init_bngmodel(): with unittest.mock.patch( "bionetgen.simulator.csimulator._new_ccompiler" ) as mock_new_comp: - with unittest.mock.patch("bionetgen.simulator.csimulator.conf") as mock_conf: - mock_conf.get.return_value = "dummy" + with unittest.mock.patch( + "bionetgen.simulator.csimulator.get_conf" + ) as mock_conf: + mock_conf.return_value = {"cvode_include": "dummy", "cvode_lib": "dummy"} with unittest.mock.patch( "bionetgen.simulator.csimulator.bionetgen.run" diff --git a/tests/test_modelapi_export_errors.py b/tests/test_modelapi_export_errors.py index 8c9a08d8..a9f6142d 100644 --- a/tests/test_modelapi_export_errors.py +++ b/tests/test_modelapi_export_errors.py @@ -226,6 +226,13 @@ def test_bngmodel_passes_path_options_to_bngparser(mock_parser_cls): from bionetgen.modelapi.model import bngmodel parser = MagicMock() + + def _fake_parse_model(model): + for b in model._block_order: + if b not in model.active_blocks: + model.active_blocks.append(b) + + parser.parse_model.side_effect = _fake_parse_model mock_parser_cls.return_value = parser bngmodel( @@ -240,6 +247,7 @@ def test_bngmodel_passes_path_options_to_bngparser(mock_parser_cls): BNGPATH="/custom/bng", generate_network=True, suppress=False, + verbose=False, ) parser.parse_model.assert_called_once()