示例#1
0
def test__real_func():
    from .for_include import func
    data = []
    include(func, data)

    assert len(data) == 1
    assert data[0] == ('func', data)
示例#2
0
def test__rel_default_func():
    data = []
    include('.for_include', data, _module='tests', _default='func')

    assert len(data) == 1
    assert data[0] == ('func', data)
示例#3
0
def test__rel_func():
    data = []
    include('.for_include.func', data, _module='tests')

    assert len(data) == 1
    assert data[0] == ('func', data)
示例#4
0
def test__rel_includeme():
    data = []
    include('.for_include', data, _module='tests')

    assert len(data) == 1
    assert data[0] == ('includeme', data)
示例#5
0
def test__includeme():
    data = []
    include('tests.for_include', data)

    assert len(data) == 1
    assert data[0] == ('includeme', data)
示例#6
0
def test__not_callable_defailt():
    with pytest.raises(TypeError):
        include('tests.for_include', _default='not_callable')
示例#7
0
def test__not_callable():
    with pytest.raises(TypeError):
        include('tests.for_include.not_callable')
示例#8
0
def test__not_found_default():
    with pytest.raises(ImportError):
        include('tests.for_include', _default='not_exist')
示例#9
0
def test__not_found():
    with pytest.raises(ImportError):
        include('tests.for_include.not_exist')
示例#10
0
def test__func():
    data = []
    include('tests.for_include.func', data)

    assert len(data) == 1
    assert data[0] == ('func', data)