예제 #1
0
def test_normalized_import_simple(mod):

    assert imports.normalized_import(
        node=ast.Import(
            names=[ast.alias(name="a.b.c.d", asname=None)],
        ),
        module=mod,
    )[0] == os.path.join('/', 'a','b','c','d')
예제 #2
0
def test_normalized_import_relative_out_bounds(mod):

    assert imports.normalized_import(
        node=ast.ImportFrom(
            module='four',
            names=[ast.alias(name='cool_feature', asname='cool')],
            level=8,
        ),
        module=mod,
    )[0] == os.path.join('/', 'four', 'cool_feature')