-
Notifications
You must be signed in to change notification settings - Fork 80
Add integration test cases for Client Location #3330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
76149bf
upgrade tcgc and azure-http-specs
v-jiaodi 341b54f
add case for azure generator core client lacation
v-jiaodi fd4037a
Merge branch 'main' into upgrade-tcgc625
v-jiaodi 65252ac
Merge branch 'main' of https://github.com/Azure/autorest.typescript i…
v-jiaodi 4ab779c
revert
v-jiaodi 6d607d5
Merge branch 'upgrade-tcgc625' of https://github.com/v-jiaodi/autores…
v-jiaodi 244da03
revert
v-jiaodi b9017cf
revert
v-jiaodi 6d543d7
fix
v-jiaodi 5f2d593
Merge branch 'main' into upgrade-tcgc625
v-jiaodi d6fb4fe
Merge branch 'main' into upgrade-tcgc625
MaryGao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
76 changes: 76 additions & 0 deletions
76
packages/typespec-ts/test/azureIntegration/azureClientGeneratorCoreClientLocation.spec.ts
This file contains hidden or 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,76 @@ | ||
| import { assert } from "chai"; | ||
| import ClientLocationClientFactory, { | ||
| ClientLocationClient | ||
| } from "./generated/azure/client-generator-core/client-location/src/index.js"; | ||
|
|
||
| describe("Azure Client Generator Core Client Location", () => { | ||
| let client: ClientLocationClient; | ||
|
|
||
| beforeEach(() => { | ||
| client = ClientLocationClientFactory({ | ||
| allowInsecureConnection: true | ||
| }); | ||
| }); | ||
|
|
||
| describe("Move to Existing Sub Client", () => { | ||
| it("should get user", async () => { | ||
| const response = await client | ||
| .path("/azure/client-generator-core/client-location/user") | ||
| .get(); | ||
|
|
||
| assert.strictEqual(response.status, "204"); | ||
| }); | ||
|
|
||
| it("should delete user", async () => { | ||
| const response = await client | ||
| .path("/azure/client-generator-core/client-location/user") | ||
| .delete(); | ||
|
|
||
| assert.strictEqual(response.status, "204"); | ||
| }); | ||
|
|
||
| it("should get admin info", async () => { | ||
| const response = await client | ||
| .path("/azure/client-generator-core/client-location/admin") | ||
| .get(); | ||
|
|
||
| assert.strictEqual(response.status, "204"); | ||
| }); | ||
| }); | ||
|
|
||
| describe("Move to New Sub Client", () => { | ||
| it("should list products", async () => { | ||
| const response = await client | ||
| .path("/azure/client-generator-core/client-location/products") | ||
| .get(); | ||
|
|
||
| assert.strictEqual(response.status, "204"); | ||
| }); | ||
|
|
||
| it("should archive product", async () => { | ||
| const response = await client | ||
| .path("/azure/client-generator-core/client-location/products/archive") | ||
| .post(); | ||
|
|
||
| assert.strictEqual(response.status, "204"); | ||
| }); | ||
| }); | ||
|
|
||
| describe("Move to Root Client", () => { | ||
| it("should get resource", async () => { | ||
| const response = await client | ||
| .path("/azure/client-generator-core/client-location/resource") | ||
| .get(); | ||
|
|
||
| assert.strictEqual(response.status, "204"); | ||
| }); | ||
|
|
||
| it("should get health status", async () => { | ||
| const response = await client | ||
| .path("/azure/client-generator-core/client-location/health") | ||
| .get(); | ||
|
|
||
| assert.strictEqual(response.status, "204"); | ||
| }); | ||
| }); | ||
| }); |
6 changes: 6 additions & 0 deletions
6
...ts/test/azureIntegration/generated/azure/client-generator-core/client-location/.gitignore
This file contains hidden or 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,6 @@ | ||
| /** | ||
| !/src | ||
| /src/** | ||
| !/src/index.d.ts | ||
| !/.gitignore | ||
| !/tspconfig.yaml |
93 changes: 93 additions & 0 deletions
93
...est/azureIntegration/generated/azure/client-generator-core/client-location/src/index.d.ts
This file contains hidden or 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,93 @@ | ||
| import type { Client } from '@azure-rest/core-client'; | ||
| import type { ClientOptions } from '@azure-rest/core-client'; | ||
| import type { HttpResponse } from '@azure-rest/core-client'; | ||
| import type { RequestParameters } from '@azure-rest/core-client'; | ||
| import type { StreamableMethod } from '@azure-rest/core-client'; | ||
|
|
||
| export declare interface ArchiveProduct { | ||
| post(options?: ArchiveProductParameters): StreamableMethod<ArchiveProduct204Response>; | ||
| } | ||
|
|
||
| export declare interface ArchiveProduct204Response extends HttpResponse { | ||
| status: "204"; | ||
| } | ||
|
|
||
| export declare type ArchiveProductParameters = RequestParameters; | ||
|
|
||
| export declare type ClientLocationClient = Client & { | ||
| path: Routes; | ||
| }; | ||
|
|
||
| export declare interface ClientLocationClientOptions extends ClientOptions { | ||
| } | ||
|
|
||
| declare function createClient(options?: ClientLocationClientOptions): ClientLocationClient; | ||
| export default createClient; | ||
|
|
||
| export declare interface DeleteUser204Response extends HttpResponse { | ||
| status: "204"; | ||
| } | ||
|
|
||
| export declare type DeleteUserParameters = RequestParameters; | ||
|
|
||
| export declare interface GetAdminInfo { | ||
| get(options?: GetAdminInfoParameters): StreamableMethod<GetAdminInfo204Response>; | ||
| } | ||
|
|
||
| export declare interface GetAdminInfo204Response extends HttpResponse { | ||
| status: "204"; | ||
| } | ||
|
|
||
| export declare type GetAdminInfoParameters = RequestParameters; | ||
|
|
||
| export declare interface GetHealthStatus { | ||
| get(options?: GetHealthStatusParameters): StreamableMethod<GetHealthStatus204Response>; | ||
| } | ||
|
|
||
| export declare interface GetHealthStatus204Response extends HttpResponse { | ||
| status: "204"; | ||
| } | ||
|
|
||
| export declare type GetHealthStatusParameters = RequestParameters; | ||
|
|
||
| export declare interface GetResource { | ||
| get(options?: GetResourceParameters): StreamableMethod<GetResource204Response>; | ||
| } | ||
|
|
||
| export declare interface GetResource204Response extends HttpResponse { | ||
| status: "204"; | ||
| } | ||
|
|
||
| export declare type GetResourceParameters = RequestParameters; | ||
|
|
||
| export declare interface GetUser { | ||
| get(options?: GetUserParameters): StreamableMethod<GetUser204Response>; | ||
| delete(options?: DeleteUserParameters): StreamableMethod<DeleteUser204Response>; | ||
| } | ||
|
|
||
| export declare interface GetUser204Response extends HttpResponse { | ||
| status: "204"; | ||
| } | ||
|
|
||
| export declare type GetUserParameters = RequestParameters; | ||
|
|
||
| export declare interface ListProducts { | ||
| get(options?: ListProductsParameters): StreamableMethod<ListProducts204Response>; | ||
| } | ||
|
|
||
| export declare interface ListProducts204Response extends HttpResponse { | ||
| status: "204"; | ||
| } | ||
|
|
||
| export declare type ListProductsParameters = RequestParameters; | ||
|
|
||
| export declare interface Routes { | ||
| (path: "/azure/client-generator-core/client-location/admin"): GetAdminInfo; | ||
| (path: "/azure/client-generator-core/client-location/user"): GetUser; | ||
| (path: "/azure/client-generator-core/client-location/products"): ListProducts; | ||
| (path: "/azure/client-generator-core/client-location/products/archive"): ArchiveProduct; | ||
| (path: "/azure/client-generator-core/client-location/resource"): GetResource; | ||
| (path: "/azure/client-generator-core/client-location/health"): GetHealthStatus; | ||
| } | ||
|
|
||
| export { } |
10 changes: 10 additions & 0 deletions
10
...est/azureIntegration/generated/azure/client-generator-core/client-location/tspconfig.yaml
This file contains hidden or 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,10 @@ | ||
| emit: | ||
| - "@azure-tools/typespec-ts" | ||
| options: | ||
| "@azure-tools/typespec-ts": | ||
| emitter-output-dir: "{project-root}" | ||
| add-credentials: false | ||
| azure-sdk-for-js: false | ||
| package-details: | ||
| name: "@azure/client-generator-core-location" | ||
| version: "1.0.0" |
46 changes: 46 additions & 0 deletions
46
...s/typespec-ts/test/azureModularIntegration/azureClientGeneratorCoreClientLocation.spec.ts
This file contains hidden or 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,46 @@ | ||
| import { ClientLocationClient } from "./generated/azure/client-generator-core/client-location/src/index.js"; | ||
|
|
||
| describe("Azure ClientGeneratorCore Client Location", () => { | ||
| let client: ClientLocationClient; | ||
|
|
||
| beforeEach(() => { | ||
| client = new ClientLocationClient({ | ||
| endpoint: "http://localhost:3002", | ||
| allowInsecureConnection: true | ||
| }); | ||
| }); | ||
|
|
||
| describe("Move to Existing Sub Client", () => { | ||
| it("should get user via userOperations", async () => { | ||
| await client.moveToExistingSubClient.userOperations.getUser(); | ||
| }); | ||
|
|
||
| it("should delete user via adminOperations", async () => { | ||
| await client.moveToExistingSubClient.adminOperations.deleteUser(); | ||
| }); | ||
|
|
||
| it("should get admin info via adminOperations", async () => { | ||
| await client.moveToExistingSubClient.adminOperations.getAdminInfo(); | ||
| }); | ||
| }); | ||
|
|
||
| describe("Move to New Sub Client", () => { | ||
| it("should list products via productOperations", async () => { | ||
| await client.moveToNewSubClient.productOperations.listProducts(); | ||
| }); | ||
|
|
||
| it("should archive product via archiveOperations", async () => { | ||
| await client.archiveOperations.archiveProduct(); | ||
| }); | ||
| }); | ||
|
|
||
| describe("Move to Root Client", () => { | ||
| it("should get resource via resourceOperations", async () => { | ||
| await client.moveToRootClient.resourceOperations.getResource(); | ||
| }); | ||
|
|
||
| it("should get health status on root client", async () => { | ||
| await client.getHealthStatus(); | ||
| }); | ||
| }); | ||
| }); |
6 changes: 6 additions & 0 deletions
6
.../azureModularIntegration/generated/azure/client-generator-core/client-location/.gitignore
This file contains hidden or 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,6 @@ | ||
| /** | ||
| !/src | ||
| /src/** | ||
| !/src/index.d.ts | ||
| !/.gitignore | ||
| !/tspconfig.yaml |
74 changes: 74 additions & 0 deletions
74
...reModularIntegration/generated/azure/client-generator-core/client-location/src/index.d.ts
This file contains hidden or 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,74 @@ | ||
| import { ClientOptions } from '@azure-rest/core-client'; | ||
| import { OperationOptions } from '@azure-rest/core-client'; | ||
| import { Pipeline } from '@azure/core-rest-pipeline'; | ||
|
|
||
| export declare interface ArchiveOperationsArchiveProductOptionalParams extends OperationOptions { | ||
| } | ||
|
|
||
| export declare interface ArchiveOperationsOperations { | ||
| archiveProduct: (options?: ArchiveOperationsArchiveProductOptionalParams) => Promise<void>; | ||
| } | ||
|
|
||
| export declare class ClientLocationClient { | ||
| private _client; | ||
| readonly pipeline: Pipeline; | ||
| constructor(options?: ClientLocationClientOptionalParams); | ||
| getHealthStatus(options?: GetHealthStatusOptionalParams): Promise<void>; | ||
| readonly archiveOperations: ArchiveOperationsOperations; | ||
| readonly moveToRootClient: MoveToRootClientOperations; | ||
| readonly moveToNewSubClient: MoveToNewSubClientOperations; | ||
| readonly moveToExistingSubClient: MoveToExistingSubClientOperations; | ||
| } | ||
|
|
||
| export declare interface ClientLocationClientOptionalParams extends ClientOptions { | ||
| } | ||
|
|
||
| export declare interface GetHealthStatusOptionalParams extends OperationOptions { | ||
| } | ||
|
|
||
| export declare interface MoveToExistingSubClientAdminOperationsDeleteUserOptionalParams extends OperationOptions { | ||
| } | ||
|
|
||
| export declare interface MoveToExistingSubClientAdminOperationsGetAdminInfoOptionalParams extends OperationOptions { | ||
| } | ||
|
|
||
| export declare interface MoveToExistingSubClientAdminOperationsOperations { | ||
| deleteUser: (options?: MoveToExistingSubClientAdminOperationsDeleteUserOptionalParams) => Promise<void>; | ||
| getAdminInfo: (options?: MoveToExistingSubClientAdminOperationsGetAdminInfoOptionalParams) => Promise<void>; | ||
| } | ||
|
|
||
| export declare interface MoveToExistingSubClientOperations { | ||
| userOperations: MoveToExistingSubClientUserOperationsOperations; | ||
| adminOperations: MoveToExistingSubClientAdminOperationsOperations; | ||
| } | ||
|
|
||
| export declare interface MoveToExistingSubClientUserOperationsGetUserOptionalParams extends OperationOptions { | ||
| } | ||
|
|
||
| export declare interface MoveToExistingSubClientUserOperationsOperations { | ||
| getUser: (options?: MoveToExistingSubClientUserOperationsGetUserOptionalParams) => Promise<void>; | ||
| } | ||
|
|
||
| export declare interface MoveToNewSubClientOperations { | ||
| productOperations: MoveToNewSubClientProductOperationsOperations; | ||
| } | ||
|
|
||
| export declare interface MoveToNewSubClientProductOperationsListProductsOptionalParams extends OperationOptions { | ||
| } | ||
|
|
||
| export declare interface MoveToNewSubClientProductOperationsOperations { | ||
| listProducts: (options?: MoveToNewSubClientProductOperationsListProductsOptionalParams) => Promise<void>; | ||
| } | ||
|
|
||
| export declare interface MoveToRootClientOperations { | ||
| resourceOperations: MoveToRootClientResourceOperationsOperations; | ||
| } | ||
|
|
||
| export declare interface MoveToRootClientResourceOperationsGetResourceOptionalParams extends OperationOptions { | ||
| } | ||
|
|
||
| export declare interface MoveToRootClientResourceOperationsOperations { | ||
| getResource: (options?: MoveToRootClientResourceOperationsGetResourceOptionalParams) => Promise<void>; | ||
| } | ||
|
|
||
| export { } |
10 changes: 10 additions & 0 deletions
10
...reModularIntegration/generated/azure/client-generator-core/client-location/tspconfig.yaml
This file contains hidden or 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,10 @@ | ||
| emit: | ||
| - "@azure-tools/typespec-ts" | ||
| options: | ||
| "@azure-tools/typespec-ts": | ||
| emitter-output-dir: "{project-root}" | ||
| add-credentials: false | ||
| azure-sdk-for-js: false | ||
| is-modular-library: true | ||
| package-details: | ||
| name: "@azure/client-generator-core-location" |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.