Esempio n. 1
0
    def test_should_get_all_firmware_drivers(self):
        firmwares = [FIRMWARE_DRIVER]
        self.resource.get_all.return_value = firmwares

        self.mock_ansible_module.params = PARAMS_GET_ALL

        FirmwareDriverFactsModule().run()

        self.mock_ansible_module.exit_json.assert_called_once_with(
            changed=False, ansible_facts=dict(firmware_drivers=firmwares))
Esempio n. 2
0
    def test_should_get_firmware_drivers_with_options(self):
        self.resource.data = FIRMWARE_DRIVER
        self.resource.get_schema.return_value = "schema"

        self.mock_ansible_module.params = PARAMS_GET_WITH_OPTIONS

        FirmwareDriverFactsModule().run()

        self.mock_ansible_module.exit_json.assert_called_once_with(
            changed=False,
            ansible_facts=dict(firmware_drivers=[], schema="schema"))
Esempio n. 3
0
    def test_should_get_firmware_drivers_by_uri(self):
        self.resource.data = FIRMWARE_DRIVER
        self.resource.get_by_uri.return_value = self.resource

        self.mock_ansible_module.params = PARAMS_GET_BY_URI

        FirmwareDriverFactsModule().run()

        self.mock_ansible_module.exit_json.assert_called_once_with(
            changed=False,
            ansible_facts=dict(firmware_drivers=FIRMWARE_DRIVER))