Пример #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