コード例 #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