From a4c417ea21207c72d0b28bd3365831f3109447ad Mon Sep 17 00:00:00 2001 From: KB-perByte Date: Mon, 8 Apr 2024 14:30:44 +0530 Subject: [PATCH] fix unused import --- tests/unit/plugins/filter/test_network.py | 33 ++++++++++++++++------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/tests/unit/plugins/filter/test_network.py b/tests/unit/plugins/filter/test_network.py index 5b8430327..39ca7e56d 100644 --- a/tests/unit/plugins/filter/test_network.py +++ b/tests/unit/plugins/filter/test_network.py @@ -20,16 +20,25 @@ __metaclass__ = type import os -import sys from unittest import TestCase -from ansible_collections.ansible.netcommon.plugins.plugin_utils.comp_type5 import comp_type5 -from ansible_collections.ansible.netcommon.plugins.plugin_utils.hash_salt import hash_salt -from ansible_collections.ansible.netcommon.plugins.plugin_utils.parse_xml import parse_xml +from ansible_collections.ansible.netcommon.plugins.plugin_utils.comp_type5 import ( + comp_type5, +) +from ansible_collections.ansible.netcommon.plugins.plugin_utils.hash_salt import ( + hash_salt, +) +from ansible_collections.ansible.netcommon.plugins.plugin_utils.parse_xml import ( + parse_xml, +) from ansible_collections.ansible.netcommon.plugins.plugin_utils.type5_pw import type5_pw -from ansible_collections.ansible.netcommon.plugins.plugin_utils.vlan_expander import vlan_expander -from ansible_collections.ansible.netcommon.plugins.plugin_utils.vlan_parser import vlan_parser +from ansible_collections.ansible.netcommon.plugins.plugin_utils.vlan_expander import ( + vlan_expander, +) +from ansible_collections.ansible.netcommon.plugins.plugin_utils.vlan_parser import ( + vlan_parser, +) fixture_path = os.path.join(os.path.dirname(__file__), "fixtures", "network") @@ -138,7 +147,9 @@ def test_parse_xml_to_dict(self): self.assertEqual(parsed, expected) def test_parse_xml_with_condition_spec(self): - spec_file_path = os.path.join(fixture_path, "show_vlans_xml_with_condition_spec.yml") + spec_file_path = os.path.join( + fixture_path, "show_vlans_xml_with_condition_spec.yml" + ) parsed = parse_xml(output_xml, spec_file_path) expected = { "vlans": [ @@ -155,7 +166,9 @@ def test_parse_xml_with_condition_spec(self): self.assertEqual(parsed, expected) def test_parse_xml_with_single_value_spec(self): - spec_file_path = os.path.join(fixture_path, "show_vlans_xml_single_value_spec.yml") + spec_file_path = os.path.join( + fixture_path, "show_vlans_xml_single_value_spec.yml" + ) parsed = parse_xml(output_xml, spec_file_path) expected = {"vlans": ["test-1", "test-2", "test-3", "test-4", "test-5"]} self.assertEqual(parsed, expected) @@ -166,7 +179,9 @@ def test_parse_xml_validate_input(self): with self.assertRaises(Exception) as e: parse_xml(output_xml, "junk_path") - self.assertEqual("unable to locate parse_xml template: junk_path", str(e.exception)) + self.assertEqual( + "unable to locate parse_xml template: junk_path", str(e.exception) + ) with self.assertRaises(Exception) as e: parse_xml(output, spec_file_path)