|
|
@ -27,11 +27,15 @@ class TestOnyxPfcInterfaceModule(TestOnyxModule):
|
|
|
|
self.mock_load_config = patch(
|
|
|
|
self.mock_load_config = patch(
|
|
|
|
'ansible.module_utils.network.onyx.onyx.load_config')
|
|
|
|
'ansible.module_utils.network.onyx.onyx.load_config')
|
|
|
|
self.load_config = self.mock_load_config.start()
|
|
|
|
self.load_config = self.mock_load_config.start()
|
|
|
|
|
|
|
|
self.mock_get_version = patch.object(
|
|
|
|
|
|
|
|
onyx_pfc_interface.OnyxPfcInterfaceModule, "_get_os_version")
|
|
|
|
|
|
|
|
self.get_version = self.mock_get_version.start()
|
|
|
|
|
|
|
|
|
|
|
|
def tearDown(self):
|
|
|
|
def tearDown(self):
|
|
|
|
super(TestOnyxPfcInterfaceModule, self).tearDown()
|
|
|
|
super(TestOnyxPfcInterfaceModule, self).tearDown()
|
|
|
|
self.mock_get_config.stop()
|
|
|
|
self.mock_get_config.stop()
|
|
|
|
self.mock_load_config.stop()
|
|
|
|
self.mock_load_config.stop()
|
|
|
|
|
|
|
|
self.mock_get_version.stop()
|
|
|
|
|
|
|
|
|
|
|
|
def load_fixtures(self, commands=None, transport='cli'):
|
|
|
|
def load_fixtures(self, commands=None, transport='cli'):
|
|
|
|
if self._pfc_enabled:
|
|
|
|
if self._pfc_enabled:
|
|
|
@ -42,6 +46,7 @@ class TestOnyxPfcInterfaceModule(TestOnyxModule):
|
|
|
|
|
|
|
|
|
|
|
|
self.get_config.return_value = load_fixture(config_file)
|
|
|
|
self.get_config.return_value = load_fixture(config_file)
|
|
|
|
self.load_config.return_value = None
|
|
|
|
self.load_config.return_value = None
|
|
|
|
|
|
|
|
self.get_version.return_value = "3.6.5000"
|
|
|
|
|
|
|
|
|
|
|
|
def _test_pfc_if(self, if_name, enabled, changed, commands):
|
|
|
|
def _test_pfc_if(self, if_name, enabled, changed, commands):
|
|
|
|
state = 'enabled' if enabled else 'disabled'
|
|
|
|
state = 'enabled' if enabled else 'disabled'
|
|
|
|