#NEWLINE# def test_faith_pd_invalid_input( self ) : #NEWLINE# #INDENT# t = TreeNode . read ( StringIO ( '(((((OTU1:0.5,OTU2:0.5):0.5,OTU3:1.0):1.0):0.0,(OTU4:0.75,OTU2:0.75):1.25):0.0)root;' ) ) #NEWLINE# counts = [ 1 , 2 , 3 ] #NEWLINE# otu_ids = [ 'OTU1' , 'OTU2' , 'OTU3' ] #NEWLINE# self . assertRaises ( DuplicateNodeError , faith_pd , counts , otu_ids , t ) #NEWLINE# t = TreeNode . read ( StringIO ( '((OTU1:0.1, OTU2:0.2):0.3, OTU3:0.5,OTU4:0.7);' ) ) #NEWLINE# counts = [ 1 , 2 , 3 ] #NEWLINE# otu_ids = [ 'OTU1' , 'OTU2' , 'OTU3' ] #NEWLINE# self . assertRaises ( ValueError , faith_pd , counts , otu_ids , t ) #NEWLINE# t = TreeNode . read ( StringIO ( '(((((OTU1:0.5,OTU2:0.5):0.5,OTU3:1.0):1.0):0.0,(OTU4:0.75,OTU5:0.75):1.25):0.0)root;' ) ) #NEWLINE# counts = [ 1 , 2 , 3 ] #NEWLINE# otu_ids = [ 'OTU1' , 'OTU2' , 'OTU2' ] #NEWLINE# self . assertRaises ( ValueError , faith_pd , counts , otu_ids , t ) #NEWLINE# t = TreeNode . read ( StringIO ( '(((((OTU1:0.5,OTU2:0.5):0.5,OTU3:1.0):1.0):0.0,(OTU4:0.75,OTU5:0.75):1.25):0.0)root;' ) ) #NEWLINE# counts = [ 1 , 2 ] #NEWLINE# otu_ids = [ 'OTU1' , 'OTU2' , 'OTU3' ] #NEWLINE# self . assertRaises ( ValueError , faith_pd , counts , otu_ids , t ) #NEWLINE# counts = [ 1 , 2 , 3 ] #NEWLINE# otu_ids = [ 'OTU1' , 'OTU2' ] #NEWLINE# self . assertRaises ( ValueError , faith_pd , counts , otu_ids , t ) #NEWLINE# t = TreeNode . read ( StringIO ( '(((((OTU1:0.5,OTU2:0.5):0.5,OTU3:1.0):1.0):0.0,(OTU4:0.75,OTU5:0.75):1.25):0.0)root;' ) ) #NEWLINE# counts = [ 1 , 2 , ( - 3 ) ] #NEWLINE# otu_ids = [ 'OTU1' , 'OTU2' , 'OTU3' ] #NEWLINE# self . assertRaises ( ValueError , faith_pd , counts , otu_ids , t ) #NEWLINE# t = TreeNode . read ( StringIO ( '((((OTU1,OTU2),OTU3)),(OTU4,OTU5));' ) ) #NEWLINE# counts = [ 1 , 2 , 3 ] #NEWLINE# otu_ids = [ 'OTU1' , 'OTU2' , 'OTU3' ] #NEWLINE# self . assertRaises ( ValueError , faith_pd , counts , otu_ids , t ) #NEWLINE# t = TreeNode . read ( StringIO ( '(((((OTU1,OTU2:0.5):0.5,OTU3:1.0):1.0):0.0,(OTU4:0.75,OTU5:0.75):1.25):0.0)root;' ) ) #NEWLINE# counts = [ 1 , 2 , 3 ] #NEWLINE# otu_ids = [ 'OTU1' , 'OTU2' , 'OTU3' ] #NEWLINE# self . assertRaises ( ValueError , faith_pd , counts , otu_ids , t ) #NEWLINE# t = TreeNode . read ( StringIO ( '(((((OTU1:0.5,OTU2:0.5):0.5,OTU3:1.0):1.0):0.0,(OTU4:0.75,OTU5:0.75):1.25):0.0)root;' ) ) #NEWLINE# counts = [ 1 , 2 , 3 ] #NEWLINE# otu_ids = [ 'OTU1' , 'OTU2' , 'OTU42' ] #NEWLINE# self . assertRaises ( MissingNodeError , faith_pd , counts , self , t )