@typespec/http-client-python 0.6.9 → 0.6.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/emitter/emitter.d.ts.map +1 -1
  2. package/dist/emitter/emitter.js +6 -2
  3. package/dist/emitter/emitter.js.map +1 -1
  4. package/emitter/src/emitter.ts +9 -5
  5. package/emitter/temp/tsconfig.tsbuildinfo +1 -1
  6. package/eng/scripts/ci/dev_requirements.txt +11 -0
  7. package/eng/scripts/ci/regenerate.ts +5 -1
  8. package/eng/scripts/setup/__pycache__/venvtools.cpython-38.pyc +0 -0
  9. package/eng/scripts/setup/build_pygen_wheel.py +1 -1
  10. package/eng/scripts/setup/install.py +2 -2
  11. package/eng/scripts/setup/run_tsp.py +1 -1
  12. package/generator/build/lib/pygen/black.py +13 -2
  13. package/generator/build/lib/pygen/codegen/models/client.py +0 -8
  14. package/generator/build/lib/pygen/codegen/serializers/builder_serializer.py +18 -33
  15. package/generator/build/lib/pygen/codegen/serializers/model_serializer.py +1 -7
  16. package/generator/build/lib/pygen/codegen/templates/client.py.jinja2 +1 -1
  17. package/generator/build/lib/pygen/codegen/templates/macros.jinja2 +2 -5
  18. package/generator/build/lib/pygen/codegen/templates/model_dpg.py.jinja2 +2 -4
  19. package/generator/build/lib/pygen/codegen/templates/model_msrest.py.jinja2 +2 -6
  20. package/generator/build/lib/pygen/codegen/templates/operation_tools.jinja2 +0 -3
  21. package/generator/build/lib/pygen/codegen/templates/serialization.py.jinja2 +1 -1
  22. package/generator/component-detection-pip-report.json +6 -3
  23. package/generator/dev_requirements.txt +1 -11
  24. package/generator/dist/pygen-0.1.0-py3-none-any.whl +0 -0
  25. package/generator/pygen/black.py +13 -2
  26. package/generator/pygen/codegen/models/client.py +0 -8
  27. package/generator/pygen/codegen/serializers/builder_serializer.py +18 -33
  28. package/generator/pygen/codegen/serializers/model_serializer.py +1 -7
  29. package/generator/pygen/codegen/templates/client.py.jinja2 +1 -1
  30. package/generator/pygen/codegen/templates/macros.jinja2 +2 -5
  31. package/generator/pygen/codegen/templates/model_dpg.py.jinja2 +2 -4
  32. package/generator/pygen/codegen/templates/model_msrest.py.jinja2 +2 -6
  33. package/generator/pygen/codegen/templates/operation_tools.jinja2 +0 -3
  34. package/generator/pygen/codegen/templates/serialization.py.jinja2 +1 -1
  35. package/generator/test/azure/mock_api_tests/asynctests/test_azure_arm_operationtemplates_async.py +92 -0
  36. package/generator/test/azure/mock_api_tests/asynctests/test_azure_arm_resource_async.py +199 -3
  37. package/generator/test/azure/mock_api_tests/test_azure_arm_operationtemplates.py +80 -0
  38. package/generator/test/azure/mock_api_tests/test_azure_arm_resource.py +187 -3
  39. package/generator/test/azure/requirements.txt +2 -9
  40. package/generator/test/azure/tox.ini +2 -2
  41. package/generator/test/dev_requirements.txt +4 -0
  42. package/generator/test/unbranded/requirements.txt +1 -10
  43. package/generator/test/unbranded/tox.ini +2 -2
  44. package/package.json +33 -31
@@ -14,7 +14,10 @@ RESOURCE_GROUP_NAME = "test-rg"
14
14
  @pytest.fixture
15
15
  async def client(credential, authentication_policy):
16
16
  async with ResourcesClient(
17
- credential, SUBSCRIPTION_ID, "http://localhost:3000", authentication_policy=authentication_policy
17
+ credential,
18
+ SUBSCRIPTION_ID,
19
+ "http://localhost:3000",
20
+ authentication_policy=authentication_policy,
18
21
  ) as client:
19
22
  yield client
20
23
 
@@ -23,7 +26,10 @@ async def client(credential, authentication_policy):
23
26
  async def test_client_signature(credential, authentication_policy):
24
27
  # make sure signautre order is correct
25
28
  client1 = ResourcesClient(
26
- credential, SUBSCRIPTION_ID, "http://localhost:3000", authentication_policy=authentication_policy
29
+ credential,
30
+ SUBSCRIPTION_ID,
31
+ "http://localhost:3000",
32
+ authentication_policy=authentication_policy,
27
33
  )
28
34
  # make sure signautre name is correct
29
35
  client2 = ResourcesClient(
@@ -36,7 +42,10 @@ async def test_client_signature(credential, authentication_policy):
36
42
  # make sure signautre order is correct
37
43
  await client.top_level.get(RESOURCE_GROUP_NAME, "top")
38
44
  # make sure signautre name is correct
39
- await client.top_level.get(resource_group_name=RESOURCE_GROUP_NAME, top_level_tracked_resource_name="top")
45
+ await client.top_level.get(
46
+ resource_group_name=RESOURCE_GROUP_NAME,
47
+ top_level_tracked_resource_name="top",
48
+ )
40
49
 
41
50
 
42
51
  @pytest.mark.asyncio
@@ -280,3 +289,190 @@ async def test_singleton_list_by_resource_group(client):
280
289
  assert result.name == "default"
281
290
  assert result.type == "Azure.ResourceManager.Resources/singletonTrackedResources"
282
291
  assert result.system_data.created_by == "AzureSDK"
292
+
293
+
294
+ @pytest.mark.asyncio
295
+ @pytest.mark.parametrize(
296
+ "scope",
297
+ [
298
+ "",
299
+ "/subscriptions/00000000-0000-0000-0000-000000000000",
300
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg",
301
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/top",
302
+ ],
303
+ )
304
+ async def test_extensions_resources_begin_create_or_update(client, scope):
305
+ result = await (
306
+ await client.extensions_resources.begin_create_or_update(
307
+ resource_uri=scope,
308
+ extensions_resource_name="extension",
309
+ resource=models.ExtensionsResource(properties=models.ExtensionsResourceProperties(description="valid")),
310
+ )
311
+ ).result()
312
+ assert result.id == f"{scope}/providers/Azure.ResourceManager.Resources/extensionsResources/extension"
313
+ assert result.name == "extension"
314
+ assert result.type == "Azure.ResourceManager.Resources/extensionsResources"
315
+ assert result.properties.description == "valid"
316
+ assert result.properties.provisioning_state == "Succeeded"
317
+ assert result.system_data.created_by == "AzureSDK"
318
+
319
+
320
+ @pytest.mark.asyncio
321
+ @pytest.mark.parametrize(
322
+ "scope",
323
+ [
324
+ "",
325
+ "/subscriptions/00000000-0000-0000-0000-000000000000",
326
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg",
327
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/top",
328
+ ],
329
+ )
330
+ async def test_extensions_resources_update(client, scope):
331
+ result = await client.extensions_resources.update(
332
+ resource_uri=scope,
333
+ extensions_resource_name="extension",
334
+ properties=models.ExtensionsResource(properties=models.ExtensionsResourceProperties(description="valid2")),
335
+ )
336
+ assert result.id == f"{scope}/providers/Azure.ResourceManager.Resources/extensionsResources/extension"
337
+ assert result.name == "extension"
338
+ assert result.type == "Azure.ResourceManager.Resources/extensionsResources"
339
+ assert result.properties.description == "valid2"
340
+ assert result.properties.provisioning_state == "Succeeded"
341
+ assert result.system_data.created_by == "AzureSDK"
342
+
343
+
344
+ @pytest.mark.asyncio
345
+ @pytest.mark.parametrize(
346
+ "scope",
347
+ [
348
+ "",
349
+ "/subscriptions/00000000-0000-0000-0000-000000000000",
350
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg",
351
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/top",
352
+ ],
353
+ )
354
+ async def test_extensions_resources_get(client, scope):
355
+ result = await client.extensions_resources.get(resource_uri=scope, extensions_resource_name="extension")
356
+ assert result.id == f"{scope}/providers/Azure.ResourceManager.Resources/extensionsResources/extension"
357
+ assert result.name == "extension"
358
+ assert result.type == "Azure.ResourceManager.Resources/extensionsResources"
359
+ assert result.properties.description == "valid"
360
+ assert result.properties.provisioning_state == "Succeeded"
361
+ assert result.system_data.created_by == "AzureSDK"
362
+
363
+
364
+ @pytest.mark.asyncio
365
+ @pytest.mark.parametrize(
366
+ "scope",
367
+ [
368
+ "",
369
+ "/subscriptions/00000000-0000-0000-0000-000000000000",
370
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg",
371
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/top",
372
+ ],
373
+ )
374
+ async def test_extensions_resources_list_by_scope(client, scope):
375
+ response = client.extensions_resources.list_by_scope(
376
+ resource_uri=scope,
377
+ )
378
+ result = [r async for r in response]
379
+ for result in result:
380
+ assert result.id == f"{scope}/providers/Azure.ResourceManager.Resources/extensionsResources/extension"
381
+ assert result.name == "extension"
382
+ assert result.type == "Azure.ResourceManager.Resources/extensionsResources"
383
+ assert result.properties.description == "valid"
384
+ assert result.properties.provisioning_state == "Succeeded"
385
+ assert result.system_data.created_by == "AzureSDK"
386
+
387
+
388
+ @pytest.mark.asyncio
389
+ @pytest.mark.parametrize(
390
+ "scope",
391
+ [
392
+ "",
393
+ "/subscriptions/00000000-0000-0000-0000-000000000000",
394
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg",
395
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/top",
396
+ ],
397
+ )
398
+ async def test_extensions_resources_delete(client, scope):
399
+ await client.extensions_resources.delete(resource_uri=scope, extensions_resource_name="extension")
400
+
401
+
402
+ @pytest.mark.asyncio
403
+ async def test_location_resources_create_or_update(client):
404
+ result = await client.location_resources.create_or_update(
405
+ location="eastus",
406
+ location_resource_name="resource",
407
+ resource=models.LocationResource(properties=models.LocationResourceProperties(description="valid")),
408
+ )
409
+ assert (
410
+ result.id
411
+ == "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Azure.ResourceManager.Resources/locations/eastus/locationResources/resource"
412
+ )
413
+ assert result.name == "resource"
414
+ assert result.type == "Azure.ResourceManager.Resources/locationResources"
415
+ assert result.properties.description == "valid"
416
+ assert result.properties.provisioning_state == "Succeeded"
417
+ assert result.system_data.created_by == "AzureSDK"
418
+
419
+
420
+ @pytest.mark.asyncio
421
+ async def test_location_resources_update(client):
422
+ result = await client.location_resources.update(
423
+ location="eastus",
424
+ location_resource_name="resource",
425
+ properties=models.LocationResource(properties=models.LocationResourceProperties(description="valid2")),
426
+ )
427
+ assert (
428
+ result.id
429
+ == "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Azure.ResourceManager.Resources/locations/eastus/locationResources/resource"
430
+ )
431
+ assert result.name == "resource"
432
+ assert result.type == "Azure.ResourceManager.Resources/locationResources"
433
+ assert result.properties.description == "valid2"
434
+ assert result.properties.provisioning_state == "Succeeded"
435
+ assert result.system_data.created_by == "AzureSDK"
436
+
437
+
438
+ @pytest.mark.asyncio
439
+ async def test_location_resources_get(client):
440
+ result = await client.location_resources.get(
441
+ location="eastus",
442
+ location_resource_name="resource",
443
+ )
444
+ assert (
445
+ result.id
446
+ == "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Azure.ResourceManager.Resources/locations/eastus/locationResources/resource"
447
+ )
448
+ assert result.name == "resource"
449
+ assert result.type == "Azure.ResourceManager.Resources/locationResources"
450
+ assert result.properties.description == "valid"
451
+ assert result.properties.provisioning_state == "Succeeded"
452
+ assert result.system_data.created_by == "AzureSDK"
453
+
454
+
455
+ @pytest.mark.asyncio
456
+ async def test_location_resources_delete(client):
457
+ await client.location_resources.delete(
458
+ location="eastus",
459
+ location_resource_name="resource",
460
+ )
461
+
462
+
463
+ @pytest.mark.asyncio
464
+ async def test_location_resources_list_by_location(client):
465
+ response = client.location_resources.list_by_location(
466
+ location="eastus",
467
+ )
468
+ result = [r async for r in response]
469
+ for result in result:
470
+ assert (
471
+ result.id
472
+ == "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Azure.ResourceManager.Resources/locations/eastus/locationResources/resource"
473
+ )
474
+ assert result.name == "resource"
475
+ assert result.type == "Azure.ResourceManager.Resources/locationResources"
476
+ assert result.properties.description == "valid"
477
+ assert result.properties.provisioning_state == "Succeeded"
478
+ assert result.system_data.created_by == "AzureSDK"
@@ -0,0 +1,80 @@
1
+ # -------------------------------------------------------------------------
2
+ # Copyright (c) Microsoft Corporation. All rights reserved.
3
+ # Licensed under the MIT License. See License.txt in the project root for
4
+ # license information.
5
+ # --------------------------------------------------------------------------
6
+ import pytest
7
+ from azure.resourcemanager.operationtemplates import OperationTemplatesClient
8
+ from azure.resourcemanager.operationtemplates import models
9
+
10
+ SUBSCRIPTION_ID = "00000000-0000-0000-0000-000000000000"
11
+ RESOURCE_GROUP_NAME = "test-rg"
12
+
13
+
14
+ @pytest.fixture
15
+ def client(credential, authentication_policy):
16
+ with OperationTemplatesClient(
17
+ credential,
18
+ SUBSCRIPTION_ID,
19
+ "http://localhost:3000",
20
+ authentication_policy=authentication_policy,
21
+ ) as client:
22
+ yield client
23
+
24
+
25
+ def test_check_name_availability_check_global(client):
26
+ result = client.check_name_availability.check_global(
27
+ body=models.CheckNameAvailabilityRequest(name="checkName", type="Microsoft.Web/site")
28
+ )
29
+ assert result.name_available == False
30
+ assert result.reason == models.CheckNameAvailabilityReason.ALREADY_EXISTS
31
+ assert result.message == "Hostname 'checkName' already exists. Please select a different name."
32
+
33
+
34
+ def test_check_name_availability_check_local(client):
35
+ result = client.check_name_availability.check_local(
36
+ location="westus",
37
+ body=models.CheckNameAvailabilityRequest(name="checkName", type="Microsoft.Web/site"),
38
+ )
39
+ assert result.name_available == False
40
+ assert result.reason == models.CheckNameAvailabilityReason.ALREADY_EXISTS
41
+ assert result.message == "Hostname 'checkName' already exists. Please select a different name."
42
+
43
+
44
+ def test_operations_list(client):
45
+ result = client.operations.list()
46
+ assert result
47
+
48
+
49
+ def test_lro_begin_create_or_replace(client):
50
+ result = client.lro.begin_create_or_replace(
51
+ resource_group_name=RESOURCE_GROUP_NAME,
52
+ order_name="order1",
53
+ resource=models.Order(
54
+ location="eastus",
55
+ properties=models.OrderProperties(product_id="product1", amount=1),
56
+ ),
57
+ ).result()
58
+ assert result.name == "order1"
59
+ assert (
60
+ result.id
61
+ == "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Azure.ResourceManager.OperationTemplates/orders/order1"
62
+ )
63
+ assert result.type == "Azure.ResourceManager.Resources/orders"
64
+ assert result.location == "eastus"
65
+ assert result.system_data.created_by == "AzureSDK"
66
+
67
+
68
+ def test_lro_begin_export(client):
69
+ client.lro.begin_export(
70
+ resource_group_name=RESOURCE_GROUP_NAME,
71
+ order_name="order1",
72
+ body=models.ExportRequest(format="csv"),
73
+ ).result()
74
+
75
+
76
+ def test_lro_begin_delete(client):
77
+ client.lro.begin_delete(
78
+ resource_group_name=RESOURCE_GROUP_NAME,
79
+ order_name="order1",
80
+ ).result()
@@ -14,7 +14,10 @@ RESOURCE_GROUP_NAME = "test-rg"
14
14
  @pytest.fixture
15
15
  def client(credential, authentication_policy):
16
16
  with ResourcesClient(
17
- credential, SUBSCRIPTION_ID, "http://localhost:3000", authentication_policy=authentication_policy
17
+ credential,
18
+ SUBSCRIPTION_ID,
19
+ "http://localhost:3000",
20
+ authentication_policy=authentication_policy,
18
21
  ) as client:
19
22
  yield client
20
23
 
@@ -22,7 +25,10 @@ def client(credential, authentication_policy):
22
25
  def test_client_signature(credential, authentication_policy):
23
26
  # make sure signautre order is correct
24
27
  client1 = ResourcesClient(
25
- credential, SUBSCRIPTION_ID, "http://localhost:3000", authentication_policy=authentication_policy
28
+ credential,
29
+ SUBSCRIPTION_ID,
30
+ "http://localhost:3000",
31
+ authentication_policy=authentication_policy,
26
32
  )
27
33
  # make sure signautre name is correct
28
34
  client2 = ResourcesClient(
@@ -35,7 +41,10 @@ def test_client_signature(credential, authentication_policy):
35
41
  # make sure signautre order is correct
36
42
  client.top_level.get(RESOURCE_GROUP_NAME, "top")
37
43
  # make sure signautre name is correct
38
- client.top_level.get(resource_group_name=RESOURCE_GROUP_NAME, top_level_tracked_resource_name="top")
44
+ client.top_level.get(
45
+ resource_group_name=RESOURCE_GROUP_NAME,
46
+ top_level_tracked_resource_name="top",
47
+ )
39
48
 
40
49
 
41
50
  def test_top_level_begin_create_or_replace(client):
@@ -250,3 +259,178 @@ def test_singleton_list_by_resource_group(client):
250
259
  assert result.name == "default"
251
260
  assert result.type == "Azure.ResourceManager.Resources/singletonTrackedResources"
252
261
  assert result.system_data.created_by == "AzureSDK"
262
+
263
+
264
+ @pytest.mark.parametrize(
265
+ "scope",
266
+ [
267
+ "",
268
+ "/subscriptions/00000000-0000-0000-0000-000000000000",
269
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg",
270
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/top",
271
+ ],
272
+ )
273
+ def test_extensions_resources_begin_create_or_update(client, scope):
274
+ result = client.extensions_resources.begin_create_or_update(
275
+ resource_uri=scope,
276
+ extensions_resource_name="extension",
277
+ resource=models.ExtensionsResource(properties=models.ExtensionsResourceProperties(description="valid")),
278
+ ).result()
279
+ assert result.id == f"{scope}/providers/Azure.ResourceManager.Resources/extensionsResources/extension"
280
+ assert result.name == "extension"
281
+ assert result.type == "Azure.ResourceManager.Resources/extensionsResources"
282
+ assert result.properties.description == "valid"
283
+ assert result.properties.provisioning_state == "Succeeded"
284
+ assert result.system_data.created_by == "AzureSDK"
285
+
286
+
287
+ @pytest.mark.parametrize(
288
+ "scope",
289
+ [
290
+ "",
291
+ "/subscriptions/00000000-0000-0000-0000-000000000000",
292
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg",
293
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/top",
294
+ ],
295
+ )
296
+ def test_extensions_resources_update(client, scope):
297
+ result = client.extensions_resources.update(
298
+ resource_uri=scope,
299
+ extensions_resource_name="extension",
300
+ properties=models.ExtensionsResource(properties=models.ExtensionsResourceProperties(description="valid2")),
301
+ )
302
+ assert result.id == f"{scope}/providers/Azure.ResourceManager.Resources/extensionsResources/extension"
303
+ assert result.name == "extension"
304
+ assert result.type == "Azure.ResourceManager.Resources/extensionsResources"
305
+ assert result.properties.description == "valid2"
306
+ assert result.properties.provisioning_state == "Succeeded"
307
+ assert result.system_data.created_by == "AzureSDK"
308
+
309
+
310
+ @pytest.mark.parametrize(
311
+ "scope",
312
+ [
313
+ "",
314
+ "/subscriptions/00000000-0000-0000-0000-000000000000",
315
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg",
316
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/top",
317
+ ],
318
+ )
319
+ def test_extensions_resources_get(client, scope):
320
+ result = client.extensions_resources.get(resource_uri=scope, extensions_resource_name="extension")
321
+ assert result.id == f"{scope}/providers/Azure.ResourceManager.Resources/extensionsResources/extension"
322
+ assert result.name == "extension"
323
+ assert result.type == "Azure.ResourceManager.Resources/extensionsResources"
324
+ assert result.properties.description == "valid"
325
+ assert result.properties.provisioning_state == "Succeeded"
326
+ assert result.system_data.created_by == "AzureSDK"
327
+
328
+
329
+ @pytest.mark.parametrize(
330
+ "scope",
331
+ [
332
+ "",
333
+ "/subscriptions/00000000-0000-0000-0000-000000000000",
334
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg",
335
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/top",
336
+ ],
337
+ )
338
+ def test_extensions_resources_list(client, scope):
339
+ response = client.extensions_resources.list_by_scope(
340
+ resource_uri=scope,
341
+ )
342
+ result = [r for r in response]
343
+ for result in result:
344
+ assert result.id == f"{scope}/providers/Azure.ResourceManager.Resources/extensionsResources/extension"
345
+ assert result.name == "extension"
346
+ assert result.type == "Azure.ResourceManager.Resources/extensionsResources"
347
+ assert result.properties.description == "valid"
348
+ assert result.properties.provisioning_state == "Succeeded"
349
+ assert result.system_data.created_by == "AzureSDK"
350
+
351
+
352
+ @pytest.mark.parametrize(
353
+ "scope",
354
+ [
355
+ "",
356
+ "/subscriptions/00000000-0000-0000-0000-000000000000",
357
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg",
358
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/top",
359
+ ],
360
+ )
361
+ def test_extensions_resources_delete(client, scope):
362
+ client.extensions_resources.delete(resource_uri=scope, extensions_resource_name="extension")
363
+
364
+
365
+ def test_location_resources_create_or_update(client):
366
+ result = client.location_resources.create_or_update(
367
+ location="eastus",
368
+ location_resource_name="resource",
369
+ resource=models.LocationResource(properties=models.LocationResourceProperties(description="valid")),
370
+ )
371
+ assert (
372
+ result.id
373
+ == "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Azure.ResourceManager.Resources/locations/eastus/locationResources/resource"
374
+ )
375
+ assert result.name == "resource"
376
+ assert result.type == "Azure.ResourceManager.Resources/locationResources"
377
+ assert result.properties.description == "valid"
378
+ assert result.properties.provisioning_state == "Succeeded"
379
+ assert result.system_data.created_by == "AzureSDK"
380
+
381
+
382
+ def test_location_resources_update(client):
383
+ result = client.location_resources.update(
384
+ location="eastus",
385
+ location_resource_name="resource",
386
+ properties=models.LocationResource(properties=models.LocationResourceProperties(description="valid2")),
387
+ )
388
+ assert (
389
+ result.id
390
+ == "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Azure.ResourceManager.Resources/locations/eastus/locationResources/resource"
391
+ )
392
+ assert result.name == "resource"
393
+ assert result.type == "Azure.ResourceManager.Resources/locationResources"
394
+ assert result.properties.description == "valid2"
395
+ assert result.properties.provisioning_state == "Succeeded"
396
+ assert result.system_data.created_by == "AzureSDK"
397
+
398
+
399
+ def test_location_resources_get(client):
400
+ result = client.location_resources.get(
401
+ location="eastus",
402
+ location_resource_name="resource",
403
+ )
404
+ assert (
405
+ result.id
406
+ == "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Azure.ResourceManager.Resources/locations/eastus/locationResources/resource"
407
+ )
408
+ assert result.name == "resource"
409
+ assert result.type == "Azure.ResourceManager.Resources/locationResources"
410
+ assert result.properties.description == "valid"
411
+ assert result.properties.provisioning_state == "Succeeded"
412
+ assert result.system_data.created_by == "AzureSDK"
413
+
414
+
415
+ def test_location_resources_delete(client):
416
+ client.location_resources.delete(
417
+ location="eastus",
418
+ location_resource_name="resource",
419
+ )
420
+
421
+
422
+ def test_location_resources_list_by_location(client):
423
+ response = client.location_resources.list_by_location(
424
+ location="eastus",
425
+ )
426
+ result = [r for r in response]
427
+ for result in result:
428
+ assert (
429
+ result.id
430
+ == "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Azure.ResourceManager.Resources/locations/eastus/locationResources/resource"
431
+ )
432
+ assert result.name == "resource"
433
+ assert result.type == "Azure.ResourceManager.Resources/locationResources"
434
+ assert result.properties.description == "valid"
435
+ assert result.properties.provisioning_state == "Succeeded"
436
+ assert result.system_data.created_by == "AzureSDK"
@@ -1,15 +1,7 @@
1
- setuptools==69.5.1
1
+ -r ../dev_requirements.txt
2
2
  -e ../../
3
- aiohttp;python_full_version>="3.5.2"
4
- requests==2.32.2
5
- pytest
6
- pytest-asyncio==0.14.0;python_full_version>="3.5.2"
7
3
  azure-core==1.30.0
8
4
  azure-mgmt-core==1.3.2
9
- pyright==1.1.391
10
- pylint==3.2.7
11
- tox==4.18.1
12
- mypy==1.14.1
13
5
 
14
6
  # only for azure
15
7
  -e ./generated/azure-client-generator-core-access
@@ -25,6 +17,7 @@ mypy==1.14.1
25
17
  -e ./generated/azure-special-headers-client-request-id/
26
18
  -e ./generated/azure-example-basic
27
19
  -e ./generated/azure-resource-manager-common-properties
20
+ -e ./generated/azure-resource-manager-operation-templates
28
21
  -e ./generated/azure-resource-manager-resources
29
22
  # -e ./generated/client-namespace
30
23
  -e ./generated/azure-payload-pageable
@@ -10,7 +10,7 @@ commands =
10
10
  pytest mock_api_tests ../generic_mock_api_tests
11
11
 
12
12
  # pylint
13
- pip install azure-pylint-guidelines-checker==0.5.0 --index-url="https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/"
13
+ pip install azure-pylint-guidelines-checker==0.5.1 --index-url="https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/"
14
14
  python ../../../eng/scripts/ci/run_pylint.py -t azure -s "generated" {posargs}
15
15
 
16
16
  # mypy
@@ -33,7 +33,7 @@ commands =
33
33
  deps=
34
34
  -r requirements.txt
35
35
  commands =
36
- pip install azure-pylint-guidelines-checker==0.5.0 --index-url="https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/"
36
+ pip install azure-pylint-guidelines-checker==0.5.1 --index-url="https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/"
37
37
  python ../../../eng/scripts/ci/run_pylint.py -t azure -s "generated" {posargs}
38
38
 
39
39
  [testenv:mypy]
@@ -0,0 +1,4 @@
1
+ -r ../../eng/scripts/ci/dev_requirements.txt
2
+ aiohttp
3
+ pytest-asyncio==0.14.0
4
+ requests==2.32.2
@@ -1,14 +1,5 @@
1
- setuptools==69.5.1
1
+ -r ../dev_requirements.txt
2
2
  -e ../../
3
- aiohttp;python_full_version>="3.5.2"
4
- requests==2.32.2
5
- pytest
6
- pytest-asyncio==0.14.0;python_full_version>="3.5.2"
7
- pyright==1.1.391
8
- pylint==3.2.7
9
- tox==4.18.1
10
- mypy==1.14.1
11
-
12
3
 
13
4
  # common test case
14
5
  -e ./generated/authentication-api-key
@@ -10,7 +10,7 @@ commands =
10
10
  pytest mock_api_tests ../generic_mock_api_tests
11
11
 
12
12
  # pylint
13
- pip install azure-pylint-guidelines-checker==0.5.0 --index-url="https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/"
13
+ pip install azure-pylint-guidelines-checker==0.5.1 --index-url="https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/"
14
14
  python ../../../eng/scripts/ci/run_pylint.py -t unbranded -s "generated" {posargs}
15
15
 
16
16
  # mypy
@@ -33,7 +33,7 @@ commands =
33
33
  deps=
34
34
  -r requirements.txt
35
35
  commands =
36
- pip install azure-pylint-guidelines-checker==0.5.0 --index-url="https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/"
36
+ pip install azure-pylint-guidelines-checker==0.5.1 --index-url="https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/"
37
37
  python ../../../eng/scripts/ci/run_pylint.py -t unbranded -s "generated" {posargs}
38
38
 
39
39
  [testenv:mypy]