Introduce parametrized fixture for collecting groups
diff --git a/cvp_checks/tests/test_default_gateway.py b/cvp_checks/tests/test_default_gateway.py
index cac5328..69fd116 100644
--- a/cvp_checks/tests/test_default_gateway.py
+++ b/cvp_checks/tests/test_default_gateway.py
@@ -4,13 +4,9 @@
from cvp_checks import utils
-@pytest.mark.parametrize(
- "group",
- utils.node_groups.keys()
-)
-def test_check_default_gateways(local_salt_client, group):
+def test_check_default_gateways(local_salt_client, nodes_in_group):
netstat_info = local_salt_client.cmd(
- "L@"+','.join(utils.node_groups[group]), 'cmd.run', ['ip r | sed -n 1p'], expr_form='compound')
+ "L@"+','.join(nodes_in_group), 'cmd.run', ['ip r | sed -n 1p'], expr_form='compound')
gateways = {}
nodes = netstat_info.keys()
@@ -22,7 +18,6 @@
gateways[netstat_info[node]].append(node)
assert len(gateways.keys()) == 1, \
- "There were found few gateways within group {group}: {gw}".format(
- group=group,
+ "There were found few gateways: {gw}".format(
gw=json.dumps(gateways, indent=4)
)