Esempio n. 1
0
    def testHeaderType(self):
        self.assertIsInstance(self.header, dict, 'header type is incorrect')

    def testHeaderContent(self):
        self.assertEqual(
            self.header.get('classification'), 'SIGNALING PROTEIN',
            'failed to get expected value for classification from header')
        self.assertEqual(
            self.header.get('experiment'), 'SOLUTION NMR',
            'failed to get expected value for experiment from header')
        self.assertEqual(
            self.header.get('deposition_date'), '25-APR-08',
            'failed to get expected value for deposition_date from header')
        self.assertEqual(
            self.header.get('identifier'), '2K39',
            'failed to get expected value for identifier from header')
        self.assertEqual(
            self.header.get('title'),
            'RECOGNITION DYNAMICS UP TO MICROSECONDS REVEALED FROM RDC '
            'DERIVED UBIQUITIN ENSEMBLE IN SOLUTION',
            'failed to get expected value for title from header dictionary')

    def tearDown(self):

        self.header = None


if __name__ == '__main__':
    unittest.main()
Esempio n. 2
0
        self.model = ANM()
        self.anm = self.model
        self.buildMatrix = self.model.buildHessian
        self.getMatrix = self.model.getHessian
        self.setMatrix = self.model.setHessian
        self.getExpected = anm.getHessian

    def testSetHessianWrongShape(self):
        """Test response to wrong shape *hessian* argument."""

        self.assertRaises(ValueError, self.model.setHessian, np.ones((5,5)))

    def testBuildHessianSlow(self):
        slow = ANM()
        slow.buildHessian(ATOMS, slow=True)
        assert_allclose(slow._getHessian(), anm._getHessian(),
                        rtol=0, atol=ATOL,
                        err_msg='slow method does not reproduce same Hessian')
        assert_equal(slow._getKirchhoff(), anm._getKirchhoff(),
                     'slow method does not reproduce same Kirchhoff')


class TestGNMCalcModes(unittest.TestCase):

    def setUp():
        pass

if __name__ == '__main__':
    unittest.main()