mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-23 07:33:27 -06:00
9c86d35a3f
- Add missing executable bits to all scripts - Remove executable bits from all files that are not scripts, e.g. js, html, and Python libraries. - Remove Python shebang from all Python library files. It's frown upon to have executable library files in site-packages. Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Armando Neto <abiagion@redhat.com>
49 lines
1.0 KiB
Python
49 lines
1.0 KiB
Python
# Copyright (C) 2017 FreeIPA Contributors see COPYING for license
|
|
|
|
import importlib
|
|
|
|
import pkg_resources
|
|
|
|
import pytest
|
|
|
|
@pytest.mark.parametrize("modname", [
|
|
# placeholder packages raise ImportError
|
|
'ipaserver',
|
|
'ipatests',
|
|
# PyPI packages do not have install subpackage
|
|
'ipaclient.install',
|
|
'ipalib.install',
|
|
'ipapython.install',
|
|
# override module should not be shipped in wheels
|
|
'ipaplatform.override',
|
|
])
|
|
def test_fail_import(modname):
|
|
try:
|
|
importlib.import_module(modname)
|
|
except ImportError:
|
|
pass
|
|
else:
|
|
pytest.fail("'import {}' does not fail".format(modname))
|
|
|
|
|
|
@pytest.mark.parametrize("modname", [
|
|
'ipaclient',
|
|
'ipalib',
|
|
'ipaplatform',
|
|
'ipapython',
|
|
])
|
|
def test_import(modname):
|
|
importlib.import_module(modname)
|
|
|
|
|
|
@pytest.mark.parametrize("pkgname", [
|
|
'ipaclient',
|
|
'ipalib',
|
|
'ipaplatform',
|
|
'ipapython',
|
|
'ipaserver',
|
|
'ipatests',
|
|
])
|
|
def test_package_installed(pkgname):
|
|
pkg_resources.require(pkgname)
|