Skip to content

Commit

Permalink
added user_agent string
Browse files Browse the repository at this point in the history
  • Loading branch information
seankane-msft committed Aug 14, 2020
1 parent 2d2be10 commit f3c32bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
from ._version import VERSION
from ._error import _process_table_error
from ._models import PartialBatchErrorException
from ._user_agent import USER_AGENT


_LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -385,8 +386,8 @@ def create_configuration(**kwargs):
# type: (**Any) -> Configuration
config = Configuration(**kwargs)
config.headers_policy = StorageHeadersPolicy(**kwargs)
config.user_agent_policy = UserAgentPolicy(
sdk_moniker="storage-{}/{}".format(kwargs.pop('storage_sdk'), VERSION), **kwargs)
config.user_agent_policy = UserAgentPolicy(sdk_moniker=USER_AGENT, **kwargs)
# sdk_moniker="storage-{}/{}".format(kwargs.pop('storage_sdk'), VERSION), **kwargs)
config.retry_policy = kwargs.get("retry_policy") or ExponentialRetry(**kwargs)
config.logging_policy = StorageLoggingPolicy(**kwargs)
config.proxy_policy = ProxyPolicy(**kwargs)
Expand Down
4 changes: 2 additions & 2 deletions sdk/tables/azure-data-tables/tests/test_table_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ def test_user_agent_custom(self, resource_group, location, storage_account, stor
def callback(response):
self.assertTrue('User-Agent' in response.http_request.headers)
self.assertIn(
"TestApp/v1.0 azsdk-python-storage-table/{} Python/{} ({})".format(
"TestApp/v1.0 azsdk-python-data-tables/{} Python/{} ({})".format(
VERSION,
platform.python_version(),
platform.platform()),
Expand All @@ -456,7 +456,7 @@ def callback(response):
def callback(response):
self.assertTrue('User-Agent' in response.http_request.headers)
self.assertIn(
"TestApp/v2.0 TestApp/v1.0 azsdk-python-storage-table/{} Python/{} ({})".format(
"TestApp/v2.0 TestApp/v1.0 azsdk-python-data-tables/{} Python/{} ({})".format(
VERSION,
platform.python_version(),
platform.platform()),
Expand Down

0 comments on commit f3c32bd

Please sign in to comment.