예제 #1
0
def test_extended_wrong_order():
    assert (promote(huge_foo, **LARGE_NAMESPACE)() == tuple(
        LARGE_NAMESPACE.values())[::-1])
예제 #2
0
def test_arg():
    assert promote(foo_with_arg, bar=BAR)(BAR_1) == (BAR, BAR_1)
예제 #3
0
def test_shadowing_arg():
    with raises(ShadowingConstantsError) as e_info:
        promote(foo_with_arg, bar_1=BAR_1)(BAR_1) == (BAR, BAR_1)
예제 #4
0
def test_closure_with_cell():
    with raises(UnsupportedCallableError) as e_info:
        promote(foo_closure_with_cell(), bar=BAR)()
예제 #5
0
def test_closure():
    assert promote(foo_closure(), bar=BAR)() == BAR
예제 #6
0
def test_non_shadowing_const():
    promote(foo_with_consts, bar=BAR)()
예제 #7
0
def test_shadowing_const():
    with raises(ShadowingConstantsError) as e_info:
        promote(foo_with_consts, bar_1=BAR_1)()
예제 #8
0
def test_locals():
    bar = BAR
    assert promote(foo, **locals())() == BAR
예제 #9
0
def test_wrong_order():
    assert promote(foo, bar_1=BAR_1, bar=BAR)() == BAR
예제 #10
0
def test_direct():
    assert promote(foo, bar=BAR)() == BAR