Check dependency of --just-phase

JIRA: COMPOSE-4020
Signed-off-by: Haibo Lin <hlin@redhat.com>
This commit is contained in:
Haibo Lin 2020-01-06 11:42:05 +08:00 committed by lsedlar
parent 3750d6795f
commit 3f111b559f
3 changed files with 34 additions and 3 deletions

View file

@ -572,3 +572,31 @@ class TestUmask(unittest.TestCase):
[mock.call.warning('Unusually strict umask detected (0%03o), '
'expect files with broken permissions.', 0o044)]
)
class TestCheckSkipPhases(unittest.TestCase):
def test_skip_phase(self):
logger = mock.Mock()
passed = checks.check_skip_phases(logger, ["gather"], [])
self.assertFalse(passed)
self.assertEqual(
logger.mock_calls,
[
mock.call.error(
"gather phase is skipped but it's needed by createrepo phase"
)
],
)
def test_just_phase(self):
logger = mock.Mock()
passed = checks.check_skip_phases(logger, [], ["gather"])
self.assertFalse(passed)
self.assertEqual(
logger.mock_calls,
[
mock.call.error(
"pkgset phase is skipped but it's needed by gather phase"
)
],
)