Exemple #1
0
 def testSynthTree(self):
     cdict = self.treemachine.synthetic_tree_info
     if self.treemachine.use_v1:
         for key in ['draftTreeName', 'startNodeTaxName', 'startNodeID', 'startNodeOTTId']:
             self.assertTrue(key in cdict)
             tree_id = cdict['draftTreeName']
             node_id = str(cdict['startNodeID'])  # Odd that this is a string
             x = self.treemachine.get_synthetic_tree(tree_id,
                                                     format='newick',
                                                     node_id=node_id,
                                                     max_depth=2)
             self.assertEqual(x['treeID'], tree_id)
             self.assertTrue(x['newick'].startswith('('))
     else:
         tree_id, node_id = test_tol_about(self, cdict)
         # This now exceed the limit for tips in a tree, so expect HTTPError (400 Client Error: Bad Request)
         # instead of the previously expected ValueError
         self.assertRaises(HTTPError,
                           self.treemachine.get_synthetic_tree,
                           tree_id,
                           format='newick',
                           node_id=node_id)
 def testSynthTree(self):
     cdict = self.ot.tree_of_life.about()
     tree_id, node_id = test_tol_about(self, cdict)
     # this service is no longer supported, so returns an HTTPError
     self.assertRaises(HTTPError, self.ot.tree_of_life.subtree, tree_id, format='newick', node_id=node_id)