tests: Skip testing pdc logs if dependencies are not installed
On EPEL 6 modulemd is not available, so the test fails with an import error. We should just skip this particular tests, as the rest of the functionality is still perfectly fine. Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
463fb961bc
commit
6f21576921
@ -10,6 +10,13 @@ import re
|
|||||||
|
|
||||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
|
||||||
|
|
||||||
|
try:
|
||||||
|
import modulemd # noqa
|
||||||
|
import pdc_client # noqa
|
||||||
|
HAS_MODULE_SUPPORT = True
|
||||||
|
except ImportError:
|
||||||
|
HAS_MODULE_SUPPORT = False
|
||||||
|
|
||||||
from pungi.phases.pkgset.sources import source_koji
|
from pungi.phases.pkgset.sources import source_koji
|
||||||
from tests import helpers
|
from tests import helpers
|
||||||
|
|
||||||
@ -118,6 +125,7 @@ class TestPopulateGlobalPkgset(helpers.PungiTestCase):
|
|||||||
with open(self.pkgset_path) as f:
|
with open(self.pkgset_path) as f:
|
||||||
self.assertEqual(f.read(), 'DATA')
|
self.assertEqual(f.read(), 'DATA')
|
||||||
|
|
||||||
|
@unittest.skipUnless(HAS_MODULE_SUPPORT, 'Modulemd/pdc_client are not available') # noqa
|
||||||
@mock.patch('six.moves.cPickle.dumps')
|
@mock.patch('six.moves.cPickle.dumps')
|
||||||
@mock.patch('pungi.phases.pkgset.pkgsets.KojiPackageSet')
|
@mock.patch('pungi.phases.pkgset.pkgsets.KojiPackageSet')
|
||||||
@mock.patch('pungi.phases.pkgset.sources.source_koji.get_module')
|
@mock.patch('pungi.phases.pkgset.sources.source_koji.get_module')
|
||||||
|
Loading…
Reference in New Issue
Block a user