Exemple #1
0
def test_chain_functions_combines_functions_in_given_order():
    x = 2345
    assert utils.chain_functions([str, len, op_neg])(x) == -len(str(x))
Exemple #2
0
def test_chain_functions_is_a_no_op_if_no_functions_are_given():
    x = 2345
    assert utils.chain_functions([])(x) is x
Exemple #3
0
def test_chain_functions_does_one_function_if_one_function_is_given():
    x = "2345"
    assert utils.chain_functions([len])(x) == 4
Exemple #4
0
def test_chain_functions_does_one_function_if_one_function_is_given():
    x = '2345'
    assert chain_functions([len])(x) == 4
Exemple #5
0
def test_chain_functions_combines_functions_in_given_order():
    x = 2345
    assert utils.chain_functions([str, len, op_neg])(x) == -len(str(x))
Exemple #6
0
def test_chain_functions_does_one_function_if_one_function_is_given():
    x = "2345"
    assert utils.chain_functions([len])(x) == 4
Exemple #7
0
def test_chain_functions_is_a_no_op_if_no_functions_are_given():
    x = 2345
    assert utils.chain_functions([])(x) is x
Exemple #8
0
def test_chain_functions_does_one_function_if_one_function_is_given():
    x = '2345'
    assert chain_functions([len])(x) == 4