Пример #1
0
def test_function_expression_fill_with_strings():
    context = Context()
    context.currentContext["name"] = "Atmaram"
    context.currentContext["place"] = "Pune"
    fun_e = FunctionExpression(
        join, [VariableExpression("name").of_type(str)]).with_argument(
            VariableExpression("place").of_type(str))
    val = fun_e.fill(context)
    assert val.value == "AtmaramPune"
Пример #2
0
def test_function_add_expression_fill_with_integer_and_string():
    context = Context()
    context.currentContext["name"] = 123
    context.currentContext["place"] = '123'
    fun_e = FunctionExpression(add, [
        VariableExpression("name").of_type(int),
        VariableExpression("place").of_type(str)
    ])
    val = fun_e.fill(context)
    assert val.value == "123123"
Пример #3
0
def test_function_expression_fill_with_string_and_integer():
    context = Context()
    context.currentContext["name"] = "Atmaram"
    context.currentContext["place"] = 123
    fun_e = FunctionExpression(join, [
        VariableExpression("name").of_type(str),
        VariableExpression("place").of_type(int)
    ])
    val = fun_e.fill(context)
    assert val.value == "Atmaram123"