1
0
Fork 0
mirror of synced 2025-07-03 20:07:28 +02:00

Rework the dependency checks to distinguish required/optional ones

Rework the dependencies definition to include a 'required' flags, which
is passed by the check_dependencies helper to the callers, so that they
can distinguish between required and optional dependencies.

This help in two ways:
- The unit test for the dependencies was now failing when an optional
  one was missing, due to a previous rework.
- Mat2's --check-dependencies was referring to "required dependencies"
  and was misleading for the user as some of them could be optional.

Signed-off-by: Antoine Tenart <antoine.tenart@ack.tf>
This commit is contained in:
Antoine Tenart 2019-05-11 11:20:05 +02:00 committed by jvoisin
parent 51ab2db279
commit f19f6ed8b6
3 changed files with 52 additions and 20 deletions

View file

@ -16,7 +16,8 @@ class TestCheckDependencies(unittest.TestCase):
def test_deps(self):
ret = check_dependencies()
for key, value in ret.items():
self.assertTrue(value, "The value for %s is False" % key)
if value['required']:
self.assertTrue(value['found'], "The value for %s is False" % key)
class TestParserFactory(unittest.TestCase):