Skip to content

Commit

Permalink
[UT] Fix 'get_device_interface_naming_mode' mock not taking effect (#341
Browse files Browse the repository at this point in the history
)

* [UT] Clear intf_naming_mode in utils

* Resolve sanity failures
  • Loading branch information
ArunSaravananBalachandran authored Feb 20, 2024
1 parent 9e1cb5d commit 5d76569
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/unit/modules/network/sonic/sonic_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
import os
import yaml

from ansible_collections.dellemc.enterprise_sonic.tests.unit.compat.mock import (
patch,
)
from ansible_collections.dellemc.enterprise_sonic.tests.unit.modules.utils import (
AnsibleExitJson,
AnsibleFailJson,
Expand All @@ -23,13 +26,21 @@ class TestSonicModule(ModuleTestCase):

def setUp(self):
super(TestSonicModule, self).setUp()
self.mock_utils_intf_naming_mode = patch(
"ansible_collections.dellemc.enterprise_sonic.plugins.module_utils.network.sonic.utils.utils.intf_naming_mode", ""
)
self.mock_utils_intf_naming_mode.start()

self.config_requests_valid = []
self.config_requests_sent = []

self._config_requests_dict = {}
self._facts_requests_dict = {}

def tearDown(self):
super(TestSonicModule, self).tearDown()
self.mock_utils_intf_naming_mode.stop()

@staticmethod
def load_fixtures(file_name, content="yaml"):
"""Load data from specified fixture file and format"""
Expand Down

0 comments on commit 5d76569

Please sign in to comment.