예제 #1
0
파일: test_siu.py 프로젝트: machow/siuba
def test_explain_binary(_, op):
    left = "_ {op} 1".format(op=op)
    sym = eval(left, {'_': _})

    assert explain(sym) == left

    right = "1 {op} _".format(op=op)
    sym = eval(right, {'_': _})

    assert explain(sym) == right
예제 #2
0
파일: test_siu.py 프로젝트: machow/siuba
def test_explain_unary(_, code):
    sym = eval(code, {'_': _})

    assert explain(sym) == code
예제 #3
0
파일: test_siu.py 프로젝트: machow/siuba
def test_explain_failures(_, expr):
    sym = eval(expr, {'_': _})
    assert explain(sym) != expr
예제 #4
0
파일: test_siu.py 프로젝트: machow/siuba
def test_source_attr(_):
    sym = _.source
    assert isinstance(sym, Symbolic)
    assert explain(sym) == "_.source"
예제 #5
0
파일: test_siu.py 프로젝트: machow/siuba
def test_explain_other(_, expr):
    sym = eval(expr, {'_': _})
    assert explain(sym) == expr