Skip to content

Commit

Permalink
move error check to new test
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjonesBSU committed Dec 19, 2023
1 parent bf87674 commit 9cff1f1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cmeutils/tests/test_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@

class TestGeometry(BaseTest):
def test_backbone_vector(self):
with pytest.raises(ValueError):
coordinates = np.array([1, 1, 1])
get_backbone_vector(coordinates)

z_coords = np.array([[0, 0, 1], [0, 0, 2], [0, 0, 3]])
backbone = get_backbone_vector(z_coords)
assert np.allclose(backbone, np.array([0, 0, 1]), atol=1e-5)
Expand All @@ -33,6 +29,11 @@ def test_backbone_vector(self):
chain_backbone = get_backbone_vector(mb_chain.xyz)
assert np.allclose(chain_backbone, np.array([0, 1, 0]), atol=1e-2)

def test_backbone_vector_bad_input(self):
with pytest.raises(ValueError):
coordinates = np.array([1, 1, 1])
get_backbone_vector(coordinates)

def test_moit(self):
_moit = moit(points=[(-1, 0, 0), (1, 0, 0)], masses=[1, 1])
assert np.array_equal(_moit, np.array([0, 2.0, 2.0]))
Expand Down

0 comments on commit 9cff1f1

Please sign in to comment.