Skip to content

Commit

Permalink
fix unused import
Browse files Browse the repository at this point in the history
  • Loading branch information
KB-perByte committed Apr 8, 2024
1 parent da0d368 commit a4c417e
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions tests/unit/plugins/filter/test_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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": [
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit a4c417e

Please sign in to comment.