コード例 #1
0
 def test_get_alpha_nofile(self):
     """Test that an error is raised if a non-existent file is given to get_alpha"""
     with self.assertRaises(FileNotFoundError):
         am.get_alpha(self.filepath + os.sep + 'TheTree.txt')
コード例 #2
0
 def test_getalpha_badfile(self):
     """Tests that an error is raised if get_alpha is called on an incompatible file"""
     with self.assertRaises(am.Rate4SiteError) as cm:
         am.get_alpha(self.filepath + os.sep + 'Fak2Human.fasta')
     err = cm.exception
     self.assertEqual(str(err), 'File format is not supported')
コード例 #3
0
 def test_get_alpha_g(self):
     """Tests that get alpha can retrieve the alpha parameter from the file"""
     digit = am.get_alpha(self.filepath + os.sep + 'multiFasta.res')
     self.assertEqual(digit, 2.83688)