From 9cff1f179dd0f3c6fb10de60fe5b4990e61f3af4 Mon Sep 17 00:00:00 2001 From: chrisjonesBSU Date: Tue, 19 Dec 2023 12:12:27 -0700 Subject: [PATCH] move error check to new test --- cmeutils/tests/test_geometry.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cmeutils/tests/test_geometry.py b/cmeutils/tests/test_geometry.py index b5c59e3..c38a577 100644 --- a/cmeutils/tests/test_geometry.py +++ b/cmeutils/tests/test_geometry.py @@ -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) @@ -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]))