diff --git a/pyproject.toml b/pyproject.toml index ff226be..ba9db1c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "fds.sdk.utils" -version = "2.1.1" +version = "2.1.2" description = "Utilities for interacting with FactSet APIs." authors = ["FactSet Research Systems"] license = "Apache-2.0" diff --git a/src/fds/sdk/utils/authentication/constants.py b/src/fds/sdk/utils/authentication/constants.py index b4835de..1d0f29c 100644 --- a/src/fds/sdk/utils/authentication/constants.py +++ b/src/fds/sdk/utils/authentication/constants.py @@ -28,7 +28,7 @@ class CONSTS: # default values FACTSET_WELL_KNOWN_URI = "https://auth.factset.com/.well-known/openid-configuration" - USER_AGENT = f"fds-sdk/python/utils/2.1.1 ({platform.system()}; Python {platform.python_version()})" + USER_AGENT = f"fds-sdk/python/utils/2.1.2 ({platform.system()}; Python {platform.python_version()})" CONSTS = CONSTS() diff --git a/tests/fds/sdk/utils/authentication/test_confidential.py b/tests/fds/sdk/utils/authentication/test_confidential.py index 17e7da3..feae57f 100644 --- a/tests/fds/sdk/utils/authentication/test_confidential.py +++ b/tests/fds/sdk/utils/authentication/test_confidential.py @@ -1,7 +1,6 @@ import json import logging -import platform -from unittest.mock import ANY, mock_open +from unittest.mock import mock_open import pytest @@ -13,6 +12,7 @@ ConfidentialClientError, ConfigurationError, OAuth2Client, + constants, ) @@ -203,7 +203,7 @@ def json(self): url="https://auth.factset.com/.well-known/openid-configuration", proxies={"http": "http://my:pass@test.test.test", "https": "http://my:pass@test.test.test"}, verify=False, - headers={"User-Agent": f"fds-sdk/python/utils/2.1.1 ({platform.system()}; Python {platform.python_version()})"}, + headers={"User-Agent": constants.CONSTS.USER_AGENT}, ) @@ -233,7 +233,7 @@ def json(self): url=auth_test, proxies=None, verify=True, - headers={"User-Agent": f"fds-sdk/python/utils/2.1.1 ({platform.system()}; Python {platform.python_version()})"}, + headers={"User-Agent": constants.CONSTS.USER_AGENT}, ) assert client @@ -378,7 +378,7 @@ def test_get_access_token_fetch(client, mocker): headers={ "Accept": "application/json", "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", - "User-Agent": f"fds-sdk/python/utils/2.1.1 ({platform.system()}; Python {platform.python_version()})", + "User-Agent": constants.CONSTS.USER_AGENT, }, )