mirror of
https://github.com/linux-system-roles/network.git
synced 2026-01-23 02:15:17 +00:00
Unit tests/initscripts: Support checking warnings
Signed-off-by: Till Maas <opensource@till.name>
This commit is contained in:
parent
3ab1a10a03
commit
e4cc5c138f
1 changed files with 11 additions and 5 deletions
|
|
@ -317,13 +317,19 @@ class TestValidator(Python26CompatTestCase):
|
|||
content_current = kwargs.get("initscripts_content_current", None)
|
||||
if content_current:
|
||||
content_current = content_current[idx]
|
||||
c = IfcfgUtil.ifcfg_create(
|
||||
connections, idx, content_current=content_current
|
||||
warnings = []
|
||||
config = IfcfgUtil.ifcfg_create(
|
||||
connections,
|
||||
idx,
|
||||
content_current=content_current,
|
||||
warn_fcn=warnings.append,
|
||||
)
|
||||
# pprint("con[%s] = \"%s\"" % (idx, connections[idx]['name']), c)
|
||||
exp = kwargs.get("initscripts_dict_expected", None)
|
||||
if exp is not None:
|
||||
self.assertEqual(exp[idx], c)
|
||||
expected_config = kwargs.get("initscripts_dict_expected", None)
|
||||
if expected_config is not None:
|
||||
self.assertEqual(expected_config[idx], config)
|
||||
expected_warnings = kwargs.get("initscripts_expected_warnings", [])
|
||||
self.assertEqual(expected_warnings, warnings)
|
||||
|
||||
def do_connections_validate(
|
||||
self, expected_connections, input_connections, **kwargs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue