Skip to content
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

migrate quota #25690

Merged
merged 2 commits into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions sdk/quota/arm-quota/assets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "js",
"TagPrefix": "js/quota/arm-quota",
"Tag": "js/quota/arm-quota_d8113b784e"
}

This file was deleted.

71 changes: 71 additions & 0 deletions sdk/quota/arm-quota/test/quota_operations_test.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/

import {
env,
Recorder,
RecorderStartOptions,
delay,
isPlaybackMode,
} from "@azure-tools/test-recorder";
import { createTestCredential } from "@azure-tools/test-credential";
import { assert } from "chai";
import { Context } from "mocha";
import { AzureQuotaExtensionAPI } from "../src/azureQuotaExtensionAPI";

const replaceableVariables: Record<string, string> = {
AZURE_CLIENT_ID: "azure_client_id",
AZURE_CLIENT_SECRET: "azure_client_secret",
AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888",
SUBSCRIPTION_ID: "azure_subscription_id"
};

const recorderOptions: RecorderStartOptions = {
envSetupForPlayback: replaceableVariables
};

export const testPollingOptions = {
updateIntervalInMs: isPlaybackMode() ? 0 : undefined,
};

describe("quota test", () => {
let recorder: Recorder;
let subscriptionId: string;
let client: AzureQuotaExtensionAPI;
let location: string;
let resourceGroup: string;
let resourcename: string;
let scope: string;

beforeEach(async function (this: Context) {
recorder = new Recorder(this.currentTest);
await recorder.start(recorderOptions);
subscriptionId = env.SUBSCRIPTION_ID || '';
// This is an example of how the environment variables are used
const credential = createTestCredential();
client = new AzureQuotaExtensionAPI(credential, recorder.configureClientOptions({}));
location = "eastus";
resourceGroup = "myjstest";
resourcename = "StandardSkuPublicIpAddresses";
scope =
"subscriptions/" + subscriptionId + "/providers/Microsoft.Network/locations/eastus"
});

afterEach(async function () {
await recorder.stop();
});

it("quota list test", async function () {
const resArray = new Array();
for await (let item of client.quota.list(scope)) {
resArray.push(item);
}
assert.notEqual(resArray.length, 0);
});

})
43 changes: 0 additions & 43 deletions sdk/quota/arm-quota/test/sampleTest.ts

This file was deleted.