import pytest from unittest.mock import patch from server.atlas.client import Config from config import ATLAS_API_CONFIG from server.atlas.client import AtlasClient from server.atlas.client import config from tests.constants import ATLAS_ERROR_401, TEST_X_USER_ID, TEST_HEADERS_FOR_ATLAS class TestAtlas: @pytest.mark.parametrize( "expected_return_data", [ (ATLAS_ERROR_401), ], ) @patch.object(config, "make_request", side_effect=[TEST_HEADERS_FOR_ATLAS, ATLAS_ERROR_401]) async def test_get_profile_info_error_atlas(self, make_request_mock, expected_return_data, app_client): result = await AtlasClient(session=app_client.session, config=Config(**ATLAS_API_CONFIG)).get_profileinfo( user_id=TEST_X_USER_ID ) assert result == expected_return_data