コード例 #1
0
def simple_multi(test_inputs: List[str], expected: str) -> None:
    state: Dict[str, object] = {}
    out = None
    for t in test_inputs:
        prog = create_program(t)
        out = prog.run(state).value

    assert str(out) == expected
コード例 #2
0
def testNotCallableError(test_input: str) -> None:
    with pytest.raises(NotCallable):
        prog = create_program(test_input)
        prog.run({})
コード例 #3
0
def testUndefinedError(test_input: str) -> None:
    with pytest.raises(UndefinedError):
        prog = create_program(test_input)
        prog.run({})
コード例 #4
0
def testParseError(test_input: str) -> None:
    with pytest.raises(ParseError):
        prog = create_program(test_input)
        prog.run({})
コード例 #5
0
def test_compute_plus(test_input: str, expected: str) -> None:
    prog = create_program(test_input)
    assert str(prog.run({}).value) == expected