#NEWLINE# def test_interactions( self ) : #NEWLINE# #INDENT# f = formula . interactions ( [ formula . Term ( l ) for l in [ 'a' , 'b' , 'c' ] ] ) #NEWLINE# assert_equal ( set ( f . termnames ( ) ) , set ( [ 'a' , 'b' , 'c' , 'a*b' , 'a*c' , 'b*c' ] ) ) #NEWLINE# f = formula . interactions ( [ formula . Term ( l ) for l in [ 'a' , 'b' , 'c' , 'd' ] ] , order = 3 ) #NEWLINE# assert_equal ( set ( f . termnames ( ) ) , set ( [ 'a' , 'b' , 'c' , 'd' , 'a*b' , 'a*c' , 'a*d' , 'b*c' , 'b*d' , 'c*d' , 'a*b*c' , 'a*c*d' , 'a*b*d' , 'b*c*d' ] ) ) #NEWLINE# f = formula . interactions ( [ formula . Term ( l ) for l in [ 'a' , 'b' , 'c' , 'd' ] ] , order = [ 1 , 2 , 3 ] ) #NEWLINE# assert_equal ( set ( f . termnames ( ) ) , set ( [ 'a' , 'b' , 'c' , 'd' , 'a*b' , 'a*c' , 'a*d' , 'b*c' , 'b*d' , 'c*d' , 'a*b*c' , 'a*c*d' , 'a*b*d' , 'b*c*d' ] ) ) #NEWLINE# f = formula . interactions ( [ formula . Term ( l ) for l in [ 'a' , 'b' , 'c' , 'd' ] ] , order = [ 3 ] ) #NEWLINE# assert_equal ( set ( f . termnames ( ) ) , set ( [ 'a*b*c' , 'a*c*d' , 'a*b*d' , 'b*c*d' ] ) )