Esempio n. 1
0
    def setUp(self):
        super(TestAsaFactsModule, self).setUp()
        self.mock_run_commands = patch(
            "ansible_collections.cisco.asa.plugins.module_utils.network.asa.facts.legacy.base.run_commands"
        )
        self.run_commands = self.mock_run_commands.start()

        self.mock_get_resource_connection = patch(
            "ansible_collections.ansible.netcommon.plugins.module_utils.network.common.facts.facts.get_resource_connection"
        )
        self.get_resource_connection = (
            self.mock_get_resource_connection.start())

        self.mock_get_capabilities = patch(
            "ansible_collections.cisco.asa.plugins.module_utils.network.asa.facts.legacy.base.get_capabilities"
        )
        self.get_capabilities = self.mock_get_capabilities.start()
        self.get_capabilities.return_value = {
            "device_info": {
                "network_os": "asa",
                "network_os_hostname": "ciscoasa",
                "network_os_image": "flash0:/vasa-adventerprisek9-m",
                "network_os_version": "9.10(1)11",
            },
            "network_api": "cliconf",
        }
Esempio n. 2
0
    def setUp(self):
        super(TestAsaOgModule, self).setUp()

        self.mock_get_config = patch('ansible_collections.cisco.asa.plugins.modules.asa_og.get_config')
        self.get_config = self.mock_get_config.start()

        self.mock_load_config = patch('ansible_collections.cisco.asa.plugins.modules.asa_og.load_config')
        self.load_config = self.mock_load_config.start()

        self.mock_get_connection = patch('ansible_collections.cisco.asa.plugins.module_utils.network.asa.asa.get_connection')
        self.get_connection = self.mock_get_connection.start()
Esempio n. 3
0
 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)
Esempio n. 4
0
    def setUp(self):
        super(TestAsaOGsModule, self).setUp()

        self.mock_get_config = patch(
            "ansible_collections.ansible.netcommon.plugins.module_utils.network.common.network.Config.get_config"
        )
        self.get_config = self.mock_get_config.start()

        self.mock_load_config = patch(
            "ansible_collections.ansible.netcommon.plugins.module_utils.network.common.network.Config.load_config"
        )
        self.load_config = self.mock_load_config.start()

        self.mock_get_resource_connection_config = patch(
            "ansible_collections.ansible.netcommon.plugins.module_utils.network.common.cfg.base."
            "get_resource_connection")
        self.get_resource_connection_config = (
            self.mock_get_resource_connection_config.start())

        self.mock_get_resource_connection_facts = patch(
            "ansible_collections.ansible.netcommon.plugins.module_utils.network.common.rm_base.resource_module_base."
            "get_resource_connection")
        self.get_resource_connection_facts = (
            self.mock_get_resource_connection_facts.start())

        self.mock_edit_config = patch(
            "ansible_collections.cisco.asa.plugins.module_utils.network.asa.providers.providers.CliProvider.edit_config"
        )
        self.edit_config = self.mock_edit_config.start()

        self.mock_execute_show_command = patch(
            "ansible_collections.cisco.asa.plugins.module_utils.network.asa.facts.ogs.ogs."
            "OGsFacts.get_og_data")
        self.execute_show_command = self.mock_execute_show_command.start()