#NEWLINE# def test_compare_rfd( self ) : #NEWLINE# #INDENT# 'compare_rfd should return the Robinson Foulds distance' #NEWLINE# t = TreeNode . read ( io . StringIO ( '((H,G),(R,M));' ) ) #NEWLINE# t2 = TreeNode . read ( io . StringIO ( '(((H,G),R),M);' ) ) #NEWLINE# t4 = TreeNode . read ( io . StringIO ( '(((H,G),(O,R)),X);' ) ) #NEWLINE# obs = t . compare_rfd ( t2 ) #NEWLINE# exp = 2.0 #NEWLINE# self . assertEqual ( obs , exp ) #NEWLINE# self . assertEqual ( t . compare_rfd ( obs ) , t2 . compare_rfd ( t ) ) #NEWLINE# obs = t . compare_rfd ( t2 , proportion = True ) #NEWLINE# exp = 0.5 #NEWLINE# self . assertEqual ( obs , exp ) #NEWLINE# with self . assertRaises ( ValueError ) : #NEWLINE# #INDENT# t . compare_rfd ( t4 )