@@ -10,27 +10,31 @@ def setUp(self):
1010 self .pdb = 'pdb/1AK4/1AK4_10w.pdb'
1111
1212 def test_align (self ):
13- """test the routine. """
13+ """Test align() """
1414
1515 for idir , axis in zip ([0 , 1 , 2 ], ['x' , 'y' , 'z' ]):
16- sql = align (self .pdb , axis = axis )
17- xyz = np .array (sql .get ('x,y,z' ))
16+ with self .assertWarns (UserWarning ) as ex :
17+ db = align (self .pdb , axis = axis )
18+ xyz = np .array (db .get ('x,y,z' ))
1819 u , v = pca (xyz )
1920 vmax = np .abs (v [:, np .argmax (u )])
2021 assert np .argmax (vmax ) == idir
2122
2223 def test_align_interface (self ):
23- """test the routine. """
24+ """Test align_interface() """
2425
25- def get_xyz_interface (sql ):
26- idx = sql .get_contact_atoms ()
26+ def get_xyz_interface (db ):
27+ idx = db .get_contact_atoms ()
2728 idx = idx ['A' ] + idx ['B' ]
28- return np .array (sql .get ('x,y,z' , rowID = idx ))
29+ return np .array (db .get ('x,y,z' , rowID = idx ))
2930
3031 for idir , plane in zip ([2 , 1 , 0 ], ['xy' , 'xz' , 'yz' ]):
31- sql = align_interface (self .pdb , plane = plane )
32- xyz = get_xyz_interface (sql )
32+ with self .assertWarns (UserWarning ) as ex :
33+ db = align_interface (self .pdb , plane = plane )
34+ xyz = get_xyz_interface (db )
3335 u , v = pca (xyz )
3436 vmax = np .abs (v [:, np .argmin (u )])
3537 assert np .argmax (vmax ) == idir
3638
39+ if __name__ == '__main__' :
40+ unittest .main ()
0 commit comments