def test_read_pickle(data_directory, mini_model, load_function): """Test the reading of model from pickle.""" if load_function is None: pytest.skip() with open(join(data_directory, "mini.pickle"), "rb") as infile: pickle_model = load_function(infile) assert compare_models(mini_model, pickle_model) is None
def test_load_json_model(data_directory, mini_model): """Test the reading of JSON model.""" json_model = cio.load_json_model(join(data_directory, "mini.json")) assert compare_models(mini_model, json_model) is None
def test_read_file_handle(data_directory, mini_model): """Test the reading of a model passed as a file handle.""" with open(join(data_directory, "mini_cobra.xml"), "rb") as file_: model_stream = BytesIO(file_.read()) read_model = io.read_sbml_model(model_stream) assert compare_models(mini_model, read_model) is None
def test_read_sbml_model(data_directory, mini_fbc1_model, mini_cobra_model): """Test the reading of a model from SBML v2.""" mini_fbc1 = io.read_legacy_sbml(join(data_directory, "mini_fbc1.xml")) mini_cobra = io.read_legacy_sbml(join(data_directory, "mini_cobra.xml")) assert compare_models(mini_fbc1_model, mini_fbc1) is None assert compare_models(mini_cobra_model, mini_cobra) is None
def test_load_yaml_model(data_directory, mini_model): """Test the reading of YAML model.""" yaml_model = cio.load_yaml_model(join(data_directory, "mini.yml")) assert compare_models(mini_model, yaml_model) is None
def test_load_matlab_model(data_directory, mini_model, raven_model): """Test the reading of MAT model.""" mini_mat_model = io.load_matlab_model(join(data_directory, "mini.mat")) raven_mat_model = io.load_matlab_model(join(data_directory, "raven.mat")) assert compare_models(mini_model, mini_mat_model) is None assert compare_models(raven_model, raven_mat_model) is None
def test_read_sbml_model(data_directory, mini_model, sbml_file): """Test the reading of a model from SBML3.""" sbml3_model = io.read_sbml_model(join(data_directory, sbml_file)) assert compare_models(mini_model, sbml3_model) is None