コード例 #1
0
    def test_should_get_sas_logical_jbod_attachment_by_name(self):
        self.resource.get_by.return_value = [SAS_LOGICAL_JBOD_2]
        self.mock_ansible_module.params = PARAMS_GET_BY_NAME

        SasLogicalJbodFactsModule().run()

        self.mock_ansible_module.exit_json.assert_called_once_with(
            changed=False,
            ansible_facts=dict(sas_logical_jbods=([SAS_LOGICAL_JBOD_2])))
コード例 #2
0
    def test_should_get_all_sas_logical_jbods(self):
        self.resource.get_all.return_value = ALL_SAS_LOGICAL_JBODS
        self.mock_ansible_module.params = PARAMS_GET_ALL

        SasLogicalJbodFactsModule().run()

        self.mock_ansible_module.exit_json.assert_called_once_with(
            changed=False,
            ansible_facts=dict(sas_logical_jbods=(ALL_SAS_LOGICAL_JBODS)))
    def test_should_get_sas_logical_jbod_with_options(self):
        self.resource.get_by.return_value = [self.SAS_LOGICAL_JBOD_2]
        self.resource.get_drives.return_value = [{"name": "Drive 1"}]
        self.mock_ansible_module.params = self.PARAMS_GET_BY_NAME_WITH_OPTIONS

        SasLogicalJbodFactsModule().run()

        self.mock_ansible_module.exit_json.assert_called_once_with(
            changed=False,
            ansible_facts=dict(sas_logical_jbods=[self.SAS_LOGICAL_JBOD_2],
                               sas_logical_jbod_drives=[{"name": "Drive 1"}])
        )