Skip to content

Commit

Permalink
small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Adafede committed Dec 18, 2023
1 parent 915b1dd commit 26fc3c4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/test_datamodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 12 additions & 6 deletions tests/test_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

0 comments on commit 26fc3c4

Please sign in to comment.