Skip to content

Commit

Permalink
fix test based on expected behavior for xyz files, remove wrong n ato…
Browse files Browse the repository at this point in the history
…ms tests, that is being tested for in GMSO test_xyz.py
  • Loading branch information
chrisjonesBSU committed Aug 26, 2024
1 parent a36825a commit 5079233
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions mbuild/tests/test_xyz.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,12 @@ def test_load_no_top(self, ethane):
# ele.Elements.H,
# }

def test_wrong_n_atoms(self):
with pytest.raises(MBuildError):
mb.load(get_fn("too_few_atoms.xyz"))
with pytest.raises(MBuildError):
mb.load(get_fn("too_many_atoms.xyz"))

def test_bad_input(self, ethane):
with pytest.raises(ValueError):
assert isinstance(ethane, mb.Compound)
write_xyz(ethane, "compound.xyz")

def test_save(self, ethane):
ethane.save(filename="ethane.xyz")
ethane_in = mb.load("ethane.xyz")
assert len(ethane_in.children) == 8
assert len(ethane_in.children) == 1
assert ethane_in.n_bonds == 0
assert set([child.name for child in ethane_in.children]) == {"C", "H"}
assert set([p.name for p in ethane_in.particles()]) == {"C", "H"}

def test_coordinates(self, ethane):
ethane.save(filename="ethane.xyz")
Expand Down

0 comments on commit 5079233

Please sign in to comment.