コード例 #1
0
ファイル: test_utils.py プロジェクト: TranQuangDuc/natsort
def test_chain_functions_combines_functions_in_given_order():
    x = 2345
    assert utils.chain_functions([str, len, op_neg])(x) == -len(str(x))
コード例 #2
0
ファイル: test_utils.py プロジェクト: TranQuangDuc/natsort
def test_chain_functions_is_a_no_op_if_no_functions_are_given():
    x = 2345
    assert utils.chain_functions([])(x) is x
コード例 #3
0
ファイル: test_utils.py プロジェクト: TranQuangDuc/natsort
def test_chain_functions_does_one_function_if_one_function_is_given():
    x = "2345"
    assert utils.chain_functions([len])(x) == 4
コード例 #4
0
def test_chain_functions_does_one_function_if_one_function_is_given():
    x = '2345'
    assert chain_functions([len])(x) == 4
コード例 #5
0
ファイル: test_utils.py プロジェクト: SethMMorton/natsort
def test_chain_functions_combines_functions_in_given_order():
    x = 2345
    assert utils.chain_functions([str, len, op_neg])(x) == -len(str(x))
コード例 #6
0
ファイル: test_utils.py プロジェクト: SethMMorton/natsort
def test_chain_functions_does_one_function_if_one_function_is_given():
    x = "2345"
    assert utils.chain_functions([len])(x) == 4
コード例 #7
0
ファイル: test_utils.py プロジェクト: SethMMorton/natsort
def test_chain_functions_is_a_no_op_if_no_functions_are_given():
    x = 2345
    assert utils.chain_functions([])(x) is x
コード例 #8
0
def test_chain_functions_does_one_function_if_one_function_is_given():
    x = '2345'
    assert chain_functions([len])(x) == 4