Example #1
0
def test_relative_imports():
    for rel in relative_imports:
        test_object = Initter(rel)
        imports = main.get_imported_libs(test_object.code)
        assert imports.describe() == test_object.targets
Example #2
0
def test_fake_packages():
    fake_import = "import mpl_toolkits"
    imports = main.get_imported_libs(fake_import)
    assert imports.describe() == {'required': {'mpl_toolkits'}}
    assert main.sanitize_deps(imports.describe()) == {}
Example #3
0
def test_imports():
    for simple_import in complex_imports + simple_imports:
        test_object = Initter(simple_import)
        imports = main.get_imported_libs(test_object.code)
        assert imports.describe() == test_object.targets