Skip to content

Commit 2bd5fbe

Browse files
committed
added get_UA_axes test to check raises for when rot axes fail but trans axes don't; one residue with multiple heavy atoms
1 parent 0b30ccc commit 2bd5fbe

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

‎tests/unit/CodeEntropy/levels/test_axes.py‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1677,3 +1677,27 @@ def _select_atoms(q):
16771677
chain = ax.get_chain(residue=residue, first=heavy_atoms[0], last=heavy_atoms[-1])
16781678

16791679
assert len(chain) == 3
1680+
1681+
1682+
def test_get_UA_axes_raises_when_only_rot_axes_fail(monkeypatch):
1683+
ax = AxesCalculator()
1684+
u = MagicMock()
1685+
u.atoms.principal_axes.return_value = np.eye(3)
1686+
u.dimensions = np.array([10.0, 10.0, 10.0, 90, 90, 90])
1687+
residue = MagicMock()
1688+
u.residues = [residue]
1689+
heavy_atoms = [
1690+
_atom(index=0, mass=12.0, pos=(1, 0, 0)),
1691+
_atom(index=1, mass=12.0, pos=(0, 1, 0)),
1692+
]
1693+
1694+
def _sel(q):
1695+
if q == "mass 2 to 999":
1696+
return heavy_atoms
1697+
1698+
u.select_atoms.side_effect = _sel
1699+
monkeypatch.setattr("CodeEntropy.levels.axes.make_whole", lambda _ag: None)
1700+
monkeypatch.setattr(ax, "get_bonded_axes", lambda **kwargs: (None, None))
1701+
1702+
with pytest.raises(ValueError):
1703+
ax.get_UA_axes(u, index=0, res_position=None)

0 commit comments

Comments
 (0)