Skip to content

Commit

Permalink
Add mock handling for edit_config_catch
Browse files Browse the repository at this point in the history
  • Loading branch information
kerry-meyer committed Aug 23, 2024
1 parent 1ebdeab commit 5896a72
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/unit/modules/network/sonic/test_sonic_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ def setUpClass(cls):
cls.mock_facts_edit_config = patch(
"ansible_collections.dellemc.enterprise_sonic.plugins.module_utils.network.sonic.facts.system.system.edit_config"
)
cls.mock_facts_edit_config_catch = patch(
"ansible_collections.dellemc.enterprise_sonic.plugins.module_utils.network.sonic.facts.system.system.edit_config_catch"
)
cls.mock_config_edit_config = patch(
"ansible_collections.dellemc.enterprise_sonic.plugins.module_utils.network.sonic.config.system.system.edit_config"
)
Expand All @@ -36,8 +39,10 @@ def setUpClass(cls):
def setUp(self):
super(TestSonicSystemModule, self).setUp()
self.facts_edit_config = self.mock_facts_edit_config.start()
self.facts_edit_config_catch = self.mock_facts_edit_config_catch.start()
self.config_edit_config = self.mock_config_edit_config.start()
self.facts_edit_config.side_effect = self.facts_side_effect
self.facts_edit_config_catch.side_effect = self.facts_side_effect
self.config_edit_config.side_effect = self.config_side_effect
self.get_interface_naming_mode = self.mock_get_interface_naming_mode.start()
self.get_interface_naming_mode.return_value = 'standard'
Expand All @@ -47,6 +52,7 @@ def setUp(self):
def tearDown(self):
super(TestSonicSystemModule, self).tearDown()
self.mock_facts_edit_config.stop()
self.mock_facts_edit_config_catch.stop()
self.mock_config_edit_config.stop()
self.mock_get_interface_naming_mode.stop()
self.mock_utils_edit_config.stop()
Expand Down

0 comments on commit 5896a72

Please sign in to comment.