def test_absent_operation_no_change(self):
        self.set_module_state('absent')
        from ansible_collections.ansible.misc.plugins.modules import netscaler_servicegroup
        servicegroup_proxy_mock = MagicMock()
        attrs = {
            'diff_object.return_value': {},
        }
        servicegroup_proxy_mock.configure_mock(**attrs)

        m = MagicMock(return_value=servicegroup_proxy_mock)
        servicegroup_exists_mock = Mock(side_effect=[False, False])

        with patch.multiple(
                'ansible_collections.ansible.misc.plugins.modules.netscaler_servicegroup',
                ConfigProxy=m,
                servicegroup_exists=servicegroup_exists_mock,
        ):
            self.module = netscaler_servicegroup
            result = self.exited()
            servicegroup_proxy_mock.assert_not_called()
            self.assertFalse(result['changed'],
                             msg='Changed status not set correctly')
    def test_absent_operation_no_change(self):
        self.set_module_state('absent')
        from ansible_collections.ansible.misc.plugins.modules import netscaler_cs_policy
        cs_policy_mock = MagicMock()
        attrs = {
            'diff_object.return_value': {},
        }
        cs_policy_mock.configure_mock(**attrs)

        m = MagicMock(return_value=cs_policy_mock)
        policy_exists_mock = Mock(side_effect=[False, False])

        with patch.multiple(
                'ansible_collections.ansible.misc.plugins.modules.netscaler_cs_policy',
                ConfigProxy=m,
                policy_exists=policy_exists_mock,
                nitro_exception=self.MockException,
                ensure_feature_is_enabled=Mock(),
        ):
            self.module = netscaler_cs_policy
            result = self.exited()
            cs_policy_mock.assert_not_called()
            self.assertFalse(result['changed'],
                             msg='Changed status not set correctly')