Ejemplo n.º 1
0
    def test_Vienna(self):
        """Vienna should initalize from several formats"""
        self.NoPairs = Vienna('.......... (0.0)')
        self.OneHelix = Vienna('((((()))))    (-1e-02)')
        self.TwoHelix = Vienna('((.))(()). \t(1.11)')
        self.ThreeHelix = Vienna('(((((..))..(((..)))..)))')
        self.GivenEnergy = Vienna('((.))', 0.1)
        self.TwoEnergies = Vienna('((.)) (4.6)', 2.1)

        self.assertEqual(self.NoPairs, '..........')
        self.assertEqual(self.NoPairs.Energy, 0.0)
        self.assertEqual(self.OneHelix, '((((()))))')
        self.assertEqual(self.OneHelix.Energy, -1e-2)
        self.assertEqual(self.TwoHelix, '((.))(()).')
        self.assertEqual(self.TwoHelix.Energy, 1.11)
        self.assertEqual(self.ThreeHelix, '(((((..))..(((..)))..)))')
        self.assertEqual(self.ThreeHelix.Energy, None)
        self.assertEqual(self.GivenEnergy.Energy, 0.1)
        self.assertEqual(self.TwoEnergies.Energy, 2.1)
Ejemplo n.º 2
0
 def test_len(self):
     """StructureString len() should match structure length"""
     self.assertEqual(len(self.TwoHelix), 10)
     #Do you want the init possible with Vienna() for empty str???
     self.assertEqual(len(Vienna('')), 0)