def test_interactions(self):
    f = formula.interactions([formula.Term(l) for l in ['a', 'b', 'c']])
    assert_equal(set(f.termnames()), set(['a', 'b', 'c', 'a*b', 'a*c', 'b*c']))
    f = formula.interactions([formula.Term(l) for l in ['a', 'b', 'c', 'd']], order=3)
    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']))
    f = formula.interactions([formula.Term(l) for l in ['a', 'b', 'c', 'd']], order=[1, 2, 3])
    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']))
    f = formula.interactions([formula.Term(l) for l in ['a', 'b', 'c', 'd']], order=[3])
    assert_equal(set(f.termnames()), set(['a*b*c', 'a*c*d', 'a*b*d', 'b*c*d']))
def test_interactions(self):
    f = formula.interactions([formula.Term(l) for l in ['a', 'b', 'c']])
    assert_equal(set(f.termnames()), set(['a', 'b', 'c', 'a*b', 'a*c', 'b*c']))
    f = formula.interactions([formula.Term(l) for l in ['a', 'b', 'c', 'd']], order=3)
    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']))
    f = formula.interactions([formula.Term(l) for l in ['a', 'b', 'c', 'd']], order=[1, 2, 3])
    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']))
    f = formula.interactions([formula.Term(l) for l in ['a', 'b', 'c', 'd']], order=[3])
    assert_equal(set(f.termnames()), set(['a*b*c', 'a*c*d', 'a*b*d', 'b*c*d']))