forked from Azure/azure-cli-extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add test cases for command examples (#49)
- Loading branch information
1 parent
69ff9f8
commit a5d7113
Showing
60 changed files
with
5,789 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
...apic-extension/azext_apic_extension/tests/latest/recordings/test_examples_create_api.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
interactions: | ||
- request: | ||
body: '{"properties": {"kind": "rest", "title": "Echo API"}}' | ||
headers: | ||
Accept: | ||
- application/json | ||
Accept-Encoding: | ||
- gzip, deflate | ||
CommandName: | ||
- apic api create | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '53' | ||
Content-Type: | ||
- application/json | ||
ParameterSetName: | ||
- -g -s --api-id --title --type | ||
User-Agent: | ||
- AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) | ||
method: PUT | ||
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/cli000003?api-version=2024-03-01 | ||
response: | ||
body: | ||
string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis","properties":{"title":"Echo | ||
API","kind":"rest","externalDocumentation":[],"contacts":[],"customProperties":{}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/cli000003","name":"cli000003","systemData":{"createdAt":"2024-05-24T07:50:59.3799269Z","lastModifiedAt":"2024-05-24T07:50:59.3799259Z"}}' | ||
headers: | ||
api-supported-versions: | ||
- 2023-07-01-preview, 2024-03-01, 2024-03-15-preview | ||
cache-control: | ||
- no-cache | ||
content-length: | ||
- '464' | ||
content-type: | ||
- application/json; charset=utf-8 | ||
date: | ||
- Fri, 24 May 2024 07:50:59 GMT | ||
etag: | ||
- 3000bd3e-0000-0100-0000-665046e30000 | ||
expires: | ||
- '-1' | ||
pragma: | ||
- no-cache | ||
strict-transport-security: | ||
- max-age=31536000; includeSubDomains | ||
vary: | ||
- Accept-Encoding | ||
x-cache: | ||
- CONFIG_NOCACHE | ||
x-content-type-options: | ||
- nosniff | ||
x-ms-ratelimit-remaining-subscription-writes: | ||
- '1199' | ||
x-msedge-ref: | ||
- 'Ref A: 73675F9FA6514297956723A9D39BBF2E Ref B: MAA201060516009 Ref C: 2024-05-24T07:50:57Z' | ||
x-powered-by: | ||
- ASP.NET | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
62 changes: 62 additions & 0 deletions
62
...ion/azext_apic_extension/tests/latest/recordings/test_examples_create_api_definition.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
interactions: | ||
- request: | ||
body: '{"properties": {"title": "OpenAPI"}}' | ||
headers: | ||
Accept: | ||
- application/json | ||
Accept-Encoding: | ||
- gzip, deflate | ||
CommandName: | ||
- apic api definition create | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '36' | ||
Content-Type: | ||
- application/json | ||
ParameterSetName: | ||
- -g -s --api-id --version-id --definition-id --title | ||
User-Agent: | ||
- AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.11.9 (Windows-10-10.0.19045-SP0) | ||
method: PUT | ||
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003/versions/clitest000004/definitions/cli000005?api-version=2024-03-01 | ||
response: | ||
body: | ||
string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis/versions/definitions","properties":{"title":"OpenAPI"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003/versions/clitest000004/definitions/cli000005","name":"cli000005","systemData":{"createdAt":"2024-05-27T02:27:49.1479171Z","lastModifiedAt":"2024-05-27T02:27:49.1479161Z"}}' | ||
headers: | ||
api-supported-versions: | ||
- 2023-07-01-preview, 2024-03-01, 2024-03-15-preview | ||
cache-control: | ||
- no-cache | ||
content-length: | ||
- '456' | ||
content-type: | ||
- application/json; charset=utf-8 | ||
date: | ||
- Mon, 27 May 2024 02:27:48 GMT | ||
etag: | ||
- 52001a88-0000-0100-0000-6653efa50000 | ||
expires: | ||
- '-1' | ||
pragma: | ||
- no-cache | ||
strict-transport-security: | ||
- max-age=31536000; includeSubDomains | ||
vary: | ||
- Accept-Encoding | ||
x-cache: | ||
- CONFIG_NOCACHE | ||
x-content-type-options: | ||
- nosniff | ||
x-ms-ratelimit-remaining-subscription-global-writes: | ||
- '2999' | ||
x-ms-ratelimit-remaining-subscription-writes: | ||
- '199' | ||
x-msedge-ref: | ||
- 'Ref A: C892758C6B5D4E91A3A952F40191D328 Ref B: MAA201060515039 Ref C: 2024-05-27T02:27:48Z' | ||
x-powered-by: | ||
- ASP.NET | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
62 changes: 62 additions & 0 deletions
62
...ension/azext_apic_extension/tests/latest/recordings/test_examples_create_api_version.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
interactions: | ||
- request: | ||
body: '{"properties": {"lifecycleStage": "production", "title": "2023-01-01"}}' | ||
headers: | ||
Accept: | ||
- application/json | ||
Accept-Encoding: | ||
- gzip, deflate | ||
CommandName: | ||
- apic api version create | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '71' | ||
Content-Type: | ||
- application/json | ||
ParameterSetName: | ||
- -g -s --api-id --version-id --title --lifecycle-stage | ||
User-Agent: | ||
- AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.11.9 (Windows-10-10.0.19045-SP0) | ||
method: PUT | ||
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003/versions/cli000004?api-version=2024-03-01 | ||
response: | ||
body: | ||
string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis/versions","properties":{"title":"2023-01-01","lifecycleStage":"production"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003/versions/cli000004","name":"cli000004","systemData":{"createdAt":"2024-05-27T03:00:25.3664586Z","lastModifiedAt":"2024-05-27T03:00:25.3664577Z"}}' | ||
headers: | ||
api-supported-versions: | ||
- 2023-07-01-preview, 2024-03-01, 2024-03-15-preview | ||
cache-control: | ||
- no-cache | ||
content-length: | ||
- '451' | ||
content-type: | ||
- application/json; charset=utf-8 | ||
date: | ||
- Mon, 27 May 2024 03:00:25 GMT | ||
etag: | ||
- 9b013724-0000-0100-0000-6653f7490000 | ||
expires: | ||
- '-1' | ||
pragma: | ||
- no-cache | ||
strict-transport-security: | ||
- max-age=31536000; includeSubDomains | ||
vary: | ||
- Accept-Encoding | ||
x-cache: | ||
- CONFIG_NOCACHE | ||
x-content-type-options: | ||
- nosniff | ||
x-ms-ratelimit-remaining-subscription-global-writes: | ||
- '2999' | ||
x-ms-ratelimit-remaining-subscription-writes: | ||
- '199' | ||
x-msedge-ref: | ||
- 'Ref A: 2EE67EE9E32D48F480C42CDA128D284F Ref B: MAA201060515031 Ref C: 2024-05-27T03:00:24Z' | ||
x-powered-by: | ||
- ASP.NET | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
62 changes: 62 additions & 0 deletions
62
...ic_extension/tests/latest/recordings/test_examples_create_api_with_custom_properties.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
interactions: | ||
- request: | ||
body: '{"properties": {"customProperties": {"clitest000003": true}, "kind": "rest", | ||
"title": "Echo API"}}' | ||
headers: | ||
Accept: | ||
- application/json | ||
Accept-Encoding: | ||
- gzip, deflate | ||
CommandName: | ||
- apic api create | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '98' | ||
Content-Type: | ||
- application/json | ||
ParameterSetName: | ||
- -g -s --api-id --title --type --custom-properties | ||
User-Agent: | ||
- AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) | ||
method: PUT | ||
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/cli000004?api-version=2024-03-01 | ||
response: | ||
body: | ||
string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis","properties":{"title":"Echo | ||
API","kind":"rest","externalDocumentation":[],"contacts":[],"customProperties":{"clitest000003":true}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/cli000004","name":"cli000004","systemData":{"createdAt":"2024-05-24T07:51:19.9191143Z","lastModifiedAt":"2024-05-24T07:51:19.9190948Z"}}' | ||
headers: | ||
api-supported-versions: | ||
- 2023-07-01-preview, 2024-03-01, 2024-03-15-preview | ||
cache-control: | ||
- no-cache | ||
content-length: | ||
- '484' | ||
content-type: | ||
- application/json; charset=utf-8 | ||
date: | ||
- Fri, 24 May 2024 07:51:19 GMT | ||
etag: | ||
- 3000c940-0000-0100-0000-665046f70000 | ||
expires: | ||
- '-1' | ||
pragma: | ||
- no-cache | ||
strict-transport-security: | ||
- max-age=31536000; includeSubDomains | ||
vary: | ||
- Accept-Encoding | ||
x-cache: | ||
- CONFIG_NOCACHE | ||
x-content-type-options: | ||
- nosniff | ||
x-ms-ratelimit-remaining-subscription-writes: | ||
- '1198' | ||
x-msedge-ref: | ||
- 'Ref A: 9BC575065296493C944EFF1CBFEA5ECF Ref B: MAA201060514033 Ref C: 2024-05-24T07:51:18Z' | ||
x-powered-by: | ||
- ASP.NET | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
66 changes: 66 additions & 0 deletions
66
...tension/azext_apic_extension/tests/latest/recordings/test_examples_create_deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
interactions: | ||
- request: | ||
body: '{"properties": {"definitionId": "/workspaces/default/apis/clitest000004/versions/clitest000005/definitions/clitest000006", | ||
"description": "Public cloud production deployment.", "environmentId": "/workspaces/default/environments/clitest000003", | ||
"server": {"runtimeUri": ["https://example.com"]}, "title": "Production deployment"}}' | ||
headers: | ||
Accept: | ||
- application/json | ||
Accept-Encoding: | ||
- gzip, deflate | ||
CommandName: | ||
- apic api deployment create | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '329' | ||
Content-Type: | ||
- application/json | ||
ParameterSetName: | ||
- -g -s --deployment-id --title --description --api-id --environment-id --definition-id | ||
--server | ||
User-Agent: | ||
- AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.11.9 (Windows-10-10.0.19045-SP0) | ||
method: PUT | ||
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000004/deployments/mock-deployment?api-version=2024-03-01 | ||
response: | ||
body: | ||
string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis/deployments","properties":{"title":"Production | ||
deployment","description":"Public cloud production deployment.","environmentId":"/workspaces/default/environments/clitest000003","definitionId":"/workspaces/default/apis/clitest000004/versions/clitest000005/definitions/clitest000006","server":{"runtimeUri":["https://example.com"]},"customProperties":{},"recommended":false},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000004/deployments/cli000007","name":"cli000007","systemData":{"createdAt":"2024-05-27T02:27:55.2453007Z","lastModifiedAt":"2024-05-27T02:27:55.2452997Z"}}' | ||
headers: | ||
api-supported-versions: | ||
- 2023-07-01-preview, 2024-03-01, 2024-03-15-preview | ||
cache-control: | ||
- no-cache | ||
content-length: | ||
- '750' | ||
content-type: | ||
- application/json; charset=utf-8 | ||
date: | ||
- Mon, 27 May 2024 02:27:55 GMT | ||
etag: | ||
- 3a01e800-0000-0100-0000-6653efab0000 | ||
expires: | ||
- '-1' | ||
pragma: | ||
- no-cache | ||
strict-transport-security: | ||
- max-age=31536000; includeSubDomains | ||
vary: | ||
- Accept-Encoding | ||
x-cache: | ||
- CONFIG_NOCACHE | ||
x-content-type-options: | ||
- nosniff | ||
x-ms-ratelimit-remaining-subscription-global-writes: | ||
- '2999' | ||
x-ms-ratelimit-remaining-subscription-writes: | ||
- '199' | ||
x-msedge-ref: | ||
- 'Ref A: 1BC0114248E04A5D83F10D5D319640C6 Ref B: MAA201060516049 Ref C: 2024-05-27T02:27:54Z' | ||
x-powered-by: | ||
- ASP.NET | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
61 changes: 61 additions & 0 deletions
61
...ension/azext_apic_extension/tests/latest/recordings/test_examples_create_environment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
interactions: | ||
- request: | ||
body: '{"properties": {"kind": "development", "title": "Public cloud"}}' | ||
headers: | ||
Accept: | ||
- application/json | ||
Accept-Encoding: | ||
- gzip, deflate | ||
CommandName: | ||
- apic environment create | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '64' | ||
Content-Type: | ||
- application/json | ||
ParameterSetName: | ||
- -g -s --environment-id --title --type | ||
User-Agent: | ||
- AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) | ||
method: PUT | ||
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/environments/cli000003?api-version=2024-03-01 | ||
response: | ||
body: | ||
string: '{"type":"Microsoft.ApiCenter/services/workspaces/environments","properties":{"title":"Public | ||
cloud","kind":"development","customProperties":{}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/environments/cli000003","name":"cli000003","systemData":{"createdAt":"2024-05-24T07:51:06.6386454Z"}}' | ||
headers: | ||
api-supported-versions: | ||
- 2023-07-01-preview, 2024-03-01, 2024-03-15-preview | ||
cache-control: | ||
- no-cache | ||
content-length: | ||
- '402' | ||
content-type: | ||
- application/json; charset=utf-8 | ||
date: | ||
- Fri, 24 May 2024 07:51:05 GMT | ||
etag: | ||
- 2500f1d8-0000-0100-0000-665046ea0000 | ||
expires: | ||
- '-1' | ||
pragma: | ||
- no-cache | ||
strict-transport-security: | ||
- max-age=31536000; includeSubDomains | ||
vary: | ||
- Accept-Encoding | ||
x-cache: | ||
- CONFIG_NOCACHE | ||
x-content-type-options: | ||
- nosniff | ||
x-ms-ratelimit-remaining-subscription-writes: | ||
- '1198' | ||
x-msedge-ref: | ||
- 'Ref A: 177FE32340EA4BFBA93D2D1E97609CEB Ref B: MAA201060515011 Ref C: 2024-05-24T07:51:05Z' | ||
x-powered-by: | ||
- ASP.NET | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
Oops, something went wrong.