#NEWLINE# def test_cardinality_mismatch_raises_error( self ) : #NEWLINE# #INDENT# self . graph . add_edges_from ( [ ( 'a' , 'b' ) , ( 'b' , 'c' ) , ( 'c' , 'd' ) , ( 'd' , 'a' ) ] ) #NEWLINE# factor_list = [ Factor ( edge , [ 2 , 2 ] , np . random . rand ( 4 ) ) for edge in self . graph . edges ( ) ] #NEWLINE# self . graph . add_factors ( * factor_list ) #NEWLINE# self . graph . add_factors ( Factor ( [ 'a' , 'b' ] , [ 2 , 3 ] , np . random . rand ( 6 ) ) ) #NEWLINE# self . assertRaises ( ValueError , self . graph . triangulate )