@@ -213,7 +213,7 @@ def test_get_UA_axes_raises_when_bonded_axes_fail(monkeypatch):
213213 heavy_atoms = [heavy_atom ]
214214
215215 def _sel (q ):
216- if q == "prop mass > 1.1 " :
216+ if q == "mass 2 to 999 " :
217217 return heavy_atoms
218218 if q .startswith ("index " ):
219219 ag = MagicMock ()
@@ -650,8 +650,18 @@ def center_of_mass(self, *args, **kwargs):
650650 def __getitem__ (self , idx ):
651651 return system_atom
652652
653+ def principal_axes (self , * args , ** kwargs ):
654+ return np .eye (3 )
655+
656+ def select_atoms (self , q ):
657+ if q == "mass 2 to 999" :
658+ return heavy_atoms
659+ if q .startswith ("index " ):
660+ return heavy_atom_selection
661+
653662 data_container = MagicMock ()
654663 data_container .atoms = _Atoms ()
664+ data_container .residues .__len__ .return_value = 1
655665 data_container .dimensions = np .array ([10.0 , 10.0 , 10.0 , 90 , 90 , 90 ], dtype = float )
656666 _FakeAtomGroup .atoms = heavy_atom_selection
657667
@@ -671,12 +681,6 @@ def _select_atoms(q):
671681 )
672682 monkeypatch .setattr (ax , "get_UA_masses" , lambda _ag : [12.0 , 12.0 ])
673683
674- got_tensor = MagicMock (return_value = np .eye (3 ))
675- monkeypatch .setattr (ax , "get_moment_of_inertia_tensor" , got_tensor )
676-
677- got_custom_axes = MagicMock (return_value = (np .eye (3 ), np .array ([3.0 , 2.0 , 1.0 ])))
678- monkeypatch .setattr (ax , "get_custom_principal_axes" , got_custom_axes )
679-
680684 trans_axes , rot_axes , center , moi = ax .get_UA_axes (
681685 data_container , index = 0 , res_position = None
682686 )
@@ -685,8 +689,6 @@ def _select_atoms(q):
685689 assert rot_axes .shape == (3 , 3 )
686690 assert np .allclose (center , np .array ([0.0 , 0.0 , 0.0 ]))
687691 assert moi .shape == (3 ,)
688- got_tensor .assert_called_once ()
689- got_custom_axes .assert_called_once ()
690692
691693
692694def test_get_bonded_axes_returns_none_none_if_custom_axes_none (monkeypatch ):
0 commit comments