Skip to content

Commit 59dfeb8

Browse files
author
Nivedit Jain
committed
2 parents 5ae8a12 + ea024ac commit 59dfeb8

33 files changed

+1286
-2151
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: ignore
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: ignore
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore

sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
except ImportError:
1818
_patch_all = []
1919
from ._patch import patch_sdk as _patch_sdk
20-
__all__ = ['LoadTestingClient']
20+
21+
__all__ = ["LoadTestingClient"]
2122
__all__.extend([p for p in _patch_all if p not in __all__])
2223

2324
_patch_sdk()

sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/_client.py

+8-23
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
from azure.core.credentials import TokenCredential
2424

25+
2526
class LoadTestingClient: # pylint: disable=client-accepts-api-version-keyword
2627
"""These APIs allow end users to create, view and run load tests using Azure Load Test Service.
2728
@@ -42,38 +43,22 @@ class LoadTestingClient: # pylint: disable=client-accepts-api-version-keyword
4243
:paramtype api_version: str
4344
"""
4445

45-
def __init__(
46-
self,
47-
endpoint: str,
48-
credential: "TokenCredential",
49-
**kwargs: Any
50-
) -> None:
51-
_endpoint = 'https://{Endpoint}'
46+
def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None:
47+
_endpoint = "https://{Endpoint}"
5248
self._config = LoadTestingClientConfiguration(endpoint=endpoint, credential=credential, **kwargs)
5349
self._client = PipelineClient(base_url=_endpoint, config=self._config, **kwargs)
5450

5551
self._serialize = Serializer()
5652
self._deserialize = Deserializer()
5753
self._serialize.client_side_validation = False
58-
self.app_component = AppComponentOperations(
59-
self._client, self._config, self._serialize, self._deserialize
60-
)
61-
self.server_metrics = ServerMetricsOperations(
62-
self._client, self._config, self._serialize, self._deserialize
63-
)
54+
self.app_component = AppComponentOperations(self._client, self._config, self._serialize, self._deserialize)
55+
self.server_metrics = ServerMetricsOperations(self._client, self._config, self._serialize, self._deserialize)
6456
self.test = TestOperations( # type: ignore # pylint: disable=abstract-class-instantiated
6557
self._client, self._config, self._serialize, self._deserialize
6658
)
67-
self.test_run = TestRunOperations(
68-
self._client, self._config, self._serialize, self._deserialize
69-
)
70-
59+
self.test_run = TestRunOperations(self._client, self._config, self._serialize, self._deserialize)
7160

72-
def send_request(
73-
self,
74-
request: HttpRequest,
75-
**kwargs: Any
76-
) -> HttpResponse:
61+
def send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
7762
"""Runs the network request through the client's chained policies.
7863
7964
>>> from azure.core.rest import HttpRequest
@@ -93,7 +78,7 @@ def send_request(
9378

9479
request_copy = deepcopy(request)
9580
path_format_arguments = {
96-
"Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True),
81+
"Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
9782
}
9883

9984
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)

sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/_configuration.py

+17-21
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,9 @@ class LoadTestingClientConfiguration(Configuration): # pylint: disable=too-many
3333
:paramtype api_version: str
3434
"""
3535

36-
def __init__(
37-
self,
38-
endpoint: str,
39-
credential: "TokenCredential",
40-
**kwargs: Any
41-
) -> None:
36+
def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None:
4237
super(LoadTestingClientConfiguration, self).__init__(**kwargs)
43-
api_version = kwargs.pop('api_version', "2022-06-01-preview") # type: str
38+
api_version = kwargs.pop("api_version", "2022-06-01-preview") # type: str
4439

4540
if endpoint is None:
4641
raise ValueError("Parameter 'endpoint' must not be None.")
@@ -50,23 +45,24 @@ def __init__(
5045
self.endpoint = endpoint
5146
self.credential = credential
5247
self.api_version = api_version
53-
self.credential_scopes = kwargs.pop('credential_scopes', ['https://loadtest.azure-dev.com/.default'])
54-
kwargs.setdefault('sdk_moniker', 'developer-loadtesting/{}'.format(VERSION))
48+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://loadtest.azure-dev.com/.default"])
49+
kwargs.setdefault("sdk_moniker", "developer-loadtesting/{}".format(VERSION))
5550
self._configure(**kwargs)
5651

5752
def _configure(
58-
self,
59-
**kwargs # type: Any
53+
self, **kwargs # type: Any
6054
):
6155
# type: (...) -> None
62-
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
63-
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
64-
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
65-
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
66-
self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs)
67-
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
68-
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
69-
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
70-
self.authentication_policy = kwargs.get('authentication_policy')
56+
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
57+
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
58+
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
59+
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
60+
self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs)
61+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
62+
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
63+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
64+
self.authentication_policy = kwargs.get("authentication_policy")
7165
if self.credential and not self.authentication_policy:
72-
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
66+
self.authentication_policy = policies.BearerTokenCredentialPolicy(
67+
self.credential, *self.credential_scopes, **kwargs
68+
)

sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/_patch.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any)
6363
self._serialize.client_side_validation = False
6464

6565
self.load_test_runs = TestRunOperations(self._client, self._config, self._serialize, self._deserialize)
66-
self.load_test_administration = LoadTestingAdministration(self._client, self._config, self._serialize,
67-
self._deserialize)
66+
self.load_test_administration = LoadTestingAdministration(
67+
self._client, self._config, self._serialize, self._deserialize
68+
)
6869

6970

7071
__all__: List[str] = ["LoadTestingClient"] # Add all objects you want publicly available to users at this package level

0 commit comments

Comments
 (0)