From 26fc3c4e888c65262d2da965cd124837f805197e Mon Sep 17 00:00:00 2001 From: Adriano Rutz Date: Mon, 18 Dec 2023 10:36:56 +0100 Subject: [PATCH] small changes --- tests/test_datamodel.py | 2 +- tests/test_update.py | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/tests/test_datamodel.py b/tests/test_datamodel.py index 8479613..a63f571 100644 --- a/tests/test_datamodel.py +++ b/tests/test_datamodel.py @@ -28,5 +28,5 @@ def test_num(self): def test_get_taxa(self): assert len(self.dm.get_taxa()) == 5 - def test_taxa_containing_structure(self): + def test_number_of_taxa_containing_structure(self): assert self.dm.get_number_of_taxa_containing_structure(1) == 2 diff --git a/tests/test_update.py b/tests/test_update.py index d78cd01..d748125 100644 --- a/tests/test_update.py +++ b/tests/test_update.py @@ -74,10 +74,16 @@ def test_merge(self): # For this one this is probably fine as we tested in the two others def test_sdf(self): - with open(self.tmp_path / "lotus.sdf", "r") as f: + generated_sdf_path = self.tmp_path / "lotus.sdf" + fixture_sdf_path = "tests/fixtures/lotus.sdf" + + with open(generated_sdf_path, "r") as f: sdf = f.read() - # If you need to update, set r to w below, and do fo.write(sdf) - # don't forget to remove it after - with open("tests/fixtures/lotus.sdf", "r") as fo: - sdf_fixture = fo.read() - assert sdf == sdf_fixture + # If you need to update, set r to w below, and do fo.write(sdf) + # don't forget to remove it after + with open(fixture_sdf_path, "r") as fo: + sdf_fixture = fo.read() + + assert ( + sdf == sdf_fixture + ), f"Content mismatch between {generated_sdf_path} and {fixture_sdf_path}"