Skip to content

Commit 084f491

Browse files
author
Nivedit Jain
committed
updated README
1 parent 59dfeb8 commit 084f491

File tree

1 file changed

+12
-10
lines changed
  • sdk/loadtestservice/azure-developer-loadtesting

1 file changed

+12
-10
lines changed

sdk/loadtestservice/azure-developer-loadtesting/README.md

+12-10
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,25 @@ Set the values of the client ID, tenant ID, and client secret of the AAD applica
3232
Use the returned token credential to authenticate the client:
3333

3434
```python
35-
from azure.developer.loadtesting import LoadTestClient
35+
from azure.developer.loadtesting import LoadTestingClient
3636
from azure.identity import DefaultAzureCredential
37-
client = LoadTestClient(endpoint='<endpoint>', credential=DefaultAzureCredential())
37+
client = LoadTestingClient(endpoint='<endpoint>', credential=DefaultAzureCredential())
3838
```
3939

4040
## Examples
4141

4242
### Creating a load test
4343
```python
44-
from azure.developer.loadtesting import LoadTestClient
44+
from azure.developer.loadtesting import LoadTestingClient
4545
from azure.identity import DefaultAzureCredential
4646
from azure.core.exceptions import HttpResponseError
4747

4848
TEST_ID = "some-test-id"
4949
DISPLAY_NAME = "new_namespace-new-namespace"
5050
SUBSCRIPTION_ID = os.environ["SUBSCRIPTION_ID"]
5151

52-
client = LoadTestClient(endpoint='<endpoint>', credential=DefaultAzureCredential())
52+
client = LoadTestingClient(endpoint='<endpoint>', credential=DefaultAzureCredential())
53+
5354
try:
5455
result = client.load_test_administration.create_or_update_test(
5556
TEST_ID,
@@ -77,34 +78,35 @@ except HttpResponseError as e:
7778

7879
### Uploading .jmx file to a Test
7980
```python
80-
from azure.developer.loadtesting import LoadTestClient
81+
from azure.developer.loadtesting import LoadTestingClient
8182
from azure.identity import DefaultAzureCredential
8283
from azure.core.exceptions import HttpResponseError
8384

8485
TEST_ID = "some-test-id"
8586
FILE_ID = "some-file-id"
8687

88+
client = LoadTestingClient(endpoint='<endpoint>', credential=DefaultAzureCredential())
89+
8790
try:
88-
# opening .jmx file
89-
body = {}
90-
body["file"] = open("sample.jmx", "rb")
9191

92-
result = client.load_test_administration.upload_test_file(TEST_ID, FILE_ID, body)
92+
result = client.load_test_administration.upload_test_file(TEST_ID, FILE_ID, open("sample.jmx", "rb"))
9393
print(result)
9494
except HttpResponseError as e:
9595
print("Failed to send JSON message: {}".format(e.response.json()))
9696
```
9797

9898
### Running a Test
9999
```python
100-
from azure.developer.loadtesting import LoadTestClient
100+
from azure.developer.loadtesting import LoadTestingClient
101101
from azure.identity import DefaultAzureCredential
102102
from azure.core.exceptions import HttpResponseError
103103

104104
TEST_ID = "some-test-id"
105105
TEST_RUN_ID = "some-testrun-id"
106106
DISPLAY_NAME = "new_namespace-new-namespace"
107107

108+
client = LoadTestingClient(endpoint='<endpoint>', credential=DefaultAzureCredential())
109+
108110
try:
109111
result = client.load_test_runs.create_and_update_test(
110112
TEST_RUN_ID,

0 commit comments

Comments
 (0)