def test_get_a_plan_script_by_name(self):
        self.i3s.plan_scripts.get_by.return_value = [self.PLAN_SCRIPT]
        self.mock_ansible_module.params = self.TASK_GET_BY_NAME

        PlanScriptFactsModule().run()

        self.mock_ansible_module.exit_json.assert_called_once_with(
            changed=False, ansible_facts=dict(plan_scripts=[self.PLAN_SCRIPT]))
Exemplo n.º 2
0
    def test_get_a_plan_script_by_name(self):
        self.resource.get_by.return_value = [self.PLAN_SCRIPT]
        self.mock_ansible_module.params = self.EXAMPLES[4][
            'image_streamer_plan_script_facts']

        PlanScriptFactsModule().run()

        self.mock_ansible_module.exit_json.assert_called_once_with(
            changed=False, ansible_facts=dict(plan_scripts=[self.PLAN_SCRIPT]))
Exemplo n.º 3
0
    def test_get_all_plan_scripts(self):
        self.resource.get_all.return_value = [self.PLAN_SCRIPT]
        self.mock_ansible_module.params = PARAMS_GET_ALL

        PlanScriptFactsModule().run()

        self.mock_ansible_module.exit_json.assert_called_once_with(
            changed=False,
            ansible_facts=dict(plan_scripts=[self.PLAN_SCRIPT])
        )
Exemplo n.º 4
0
    def test_get_useby_and_read_only(self):
        self.resource.get_by.return_value = [self.PLAN_SCRIPT]
        self.resource.get_usedby_and_readonly.return_value = self.USE_BY

        self.mock_ansible_module.params = PARAMS_GET_USEBY

        PlanScriptFactsModule().run()

        self.mock_ansible_module.exit_json.assert_called_once_with(
            changed=False,
            ansible_facts=dict(plan_scripts=[self.PLAN_SCRIPT], use_by=self.USE_BY)
        )