mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-25 08:21:05 -06:00
3a5b3be8b9
Add tox infrastructure to test client wheel packages workflow: * build client packages * install client packages * ipa-run-tests --ipaclient-unittests under Python 2 and 3 * pylint of client packages under Python 2 and 3 * placeholder packages work as expected Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Martin Basti <mbasti@redhat.com>
48 lines
968 B
Python
48 lines
968 B
Python
#!/usr/bin/env 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
|
|
'ipaplatform',
|
|
'ipaserver',
|
|
'ipatests',
|
|
# PyPI packages do not have install subpackage
|
|
'ipaclient.install',
|
|
'ipalib.install',
|
|
'ipapython.install',
|
|
])
|
|
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',
|
|
'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)
|