pungi/tests/test_gather_method_nodeps.py
Lubomír Sedlář 7c5020e82d Reduce duplication in tests
Set the dummy compose into non-debug mode in a single place, and only
change it when needed.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2018-08-29 15:52:45 +02:00

26 lines
872 B
Python

# -*- coding: utf-8 -*-
import mock
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
from pungi.phases.gather.methods import method_nodeps as nodeps
from tests import helpers
COMPS_FILE = os.path.join(helpers.FIXTURE_DIR, 'comps.xml')
class TestWritePungiConfig(helpers.PungiTestCase):
def setUp(self):
super(TestWritePungiConfig, self).setUp()
self.compose = helpers.DummyCompose(self.topdir, {})
self.compose.paths.work.comps = mock.Mock(return_value=COMPS_FILE)
def test_expand_group(self):
packages = nodeps.expand_groups(self.compose, 'x86_64', None, ['core', 'text-internet'])
self.assertItemsEqual(packages, [('dummy-bash', 'x86_64'),
('dummy-elinks', 'x86_64'),
('dummy-tftp', 'x86_64')])