def setUp(self): super(TestCloudEngineLacpModule, self).setUp() self.mock_get_config = patch('ansible_collections.huawei.cloudengine.plugins.modules.ce_mdn_interface.get_nc_config') self.get_nc_config = self.mock_get_config.start() self.mock_set_config = patch('ansible_collections.huawei.cloudengine.plugins.modules.ce_mdn_interface.set_nc_config') self.set_nc_config = self.mock_set_config.start() self.set_nc_config.return_value = "<ok/>" self.before = load_fixture('ce_mdn_interface', 'before.txt') self.after = load_fixture('ce_mdn_interface', 'after.txt')
def setUp(self): super(TestCloudEngineLacpModule, self).setUp() self.mock_get_config = patch( 'ansible_collections.huawei.cloudengine.plugins.modules.ce_lacp.get_nc_config' ) self.get_nc_config = self.mock_get_config.start() self.mock_set_config = patch( 'ansible_collections.huawei.cloudengine.plugins.modules.ce_lacp.set_nc_config' ) self.set_nc_config = self.mock_set_config.start() self.set_nc_config.return_value = None
def setUp(self): super(TestCloudEngineLacpModule, self).setUp() self.mock_get_config = patch( 'ansible_collections.huawei.cloudengine.plugins.modules.ce_static_route_bfd.get_nc_config' ) self.get_nc_config = self.mock_get_config.start() self.mock_set_config = patch( 'ansible_collections.huawei.cloudengine.plugins.modules.ce_static_route_bfd.set_nc_config' ) self.set_nc_config = self.mock_set_config.start() self.set_nc_config.return_value = load_fixture('ce_lldp', 'result_ok.txt')
def setUp(self): super(TestCloudEngineLacpModule, self).setUp() # self.mock_get_config = patch('ansible.modules.network.cloudengine.ce_lldp.get_nc_config') self.mock_get_config = patch( 'ansible_collections.huawei.cloudengine.plugins.modules.ce_lldp_interface.get_nc_config' ) self.get_nc_config = self.mock_get_config.start() self.mock_set_nc_config = patch( 'ansible_collections.huawei.cloudengine.plugins.modules.ce_lldp_interface.set_nc_config' ) self.set_nc_config = self.mock_set_nc_config.start() self.xml_absent = load_fixture('ce_lldp_interface', 'lldp_interface_existing.txt') self.xml_present = load_fixture('ce_lldp_interface', 'lldp_interface_changed.txt') self.result_ok = load_fixture('ce_lldp_interface', 'result_ok.txt')
def setUp(self): self.mock_module = patch.multiple(basic.AnsibleModule, exit_json=exit_json, fail_json=fail_json) self.mock_module.start() self.mock_sleep = patch('time.sleep') self.mock_sleep.start() set_module_args({}) self.addCleanup(self.mock_module.stop) self.addCleanup(self.mock_sleep.stop)
def setUp(self): super(TestCloudEngineLacpModule, self).setUp() self.mock_get_config = patch( 'ansible_collections.huawei.cloudengine.plugins.modules.ce_lldp.get_nc_config' ) self.get_nc_config = self.mock_get_config.start() self.mock_set_config = patch( 'ansible_collections.huawei.cloudengine.plugins.modules.ce_lldp.set_nc_config' ) self.set_nc_config = self.mock_set_config.start() self.set_nc_config.return_value = None xml_existing_1 = load_fixture('ce_lldp', 'ce_lldp_global_00.txt') xml_existing_2 = load_fixture('ce_lldp', 'ce_lldp_global_01.txt') xml_end_state_1 = load_fixture('ce_lldp', 'ce_lldpSysParameter_00.txt') xml_end_state_2 = load_fixture('ce_lldp', 'ce_lldpSysParameter_01.txt') self.get_side_effect = (xml_existing_1, xml_existing_2, xml_end_state_1, xml_end_state_2) self.result_ok = load_fixture('ce_lldp', 'result_ok.txt')