From ab996acb36293938005bb65d2af1ba667f5b6e6b Mon Sep 17 00:00:00 2001 From: Bertrand Lanson Date: Sun, 15 Sep 2024 15:38:00 +0200 Subject: [PATCH] test: remove unused tests --- .../modules/test_public_cloud_config_info.py | 51 +------------------ 1 file changed, 2 insertions(+), 49 deletions(-) diff --git a/tests/unit/plugins/modules/test_public_cloud_config_info.py b/tests/unit/plugins/modules/test_public_cloud_config_info.py index 032d6da..23c88ce 100644 --- a/tests/unit/plugins/modules/test_public_cloud_config_info.py +++ b/tests/unit/plugins/modules/test_public_cloud_config_info.py @@ -1,7 +1,7 @@ import unittest -import json import pytest -from unittest.mock import patch, MagicMock +import json +from unittest.mock import patch, MagicMock, Mock from ansible.module_utils.basic import AnsibleModule from ansible.module_utils import basic from ansible.module_utils.common.text.converters import to_bytes @@ -90,53 +90,6 @@ class TestPublicCloudConfigInfoModule(unittest.TestCase): changed=False, config=api_response_data["data"] ) - # def test_successful_retrieval(self): - # """ - # Test a successful retrieval of public cloud configuration. - # """ - # set_module_args( - # { - # "api_token": "mock_api_token", - # "account_id": "mock_account_id", - # } - # ) - # - # api_response_data = { - # "result": "success", - # "data": { - # "free_tier": 300, - # "free_tier_used": 24.34, - # "account_resource_level": 2, - # "valid_from": 1707584356, - # "valid_to": 1717192799, - # "project_count": 2, - # }, - # } - # - # self.mock_client_instance.get.return_value = api_response_data - # - # with patch.object( - # AnsibleModule, "exit_json", side_effect=exit_json - # ) as mock_exit_json: - # with patch.object( - # AnsibleModule, "fail_json", side_effect=fail_json - # ) as mock_fail_json: - # with pytest.raises(AnsibleExitJson) as e: - # public_cloud_config_info.main() - # mock_fail_json.assert_not_called() - # result = e.value.kwargs - # assert result["changed"] is False - # assert "config" in result - # assert result["config"] == api_response_data["data"] - # mock_exit_json.assert_called_once() - # self.mock_client_class.assert_called_with( - # api_version="1", api_token="mock_api_token" - # ) - # self.mock_client_instance.get.assert_called_once_with( - # "/public_clouds/config", - # params={"account_id": "mock_account_id"}, - # ) - def test_missing_required_params(self): """ Test behavior when required parameters are missing.