Initial commit

This commit is contained in:
2025-03-07 19:22:02 +01:00
commit 4a98255d83
55743 changed files with 5280367 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=sampleTest.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"sampleTest.d.ts","sourceRoot":"","sources":["../../test/sampleTest.ts"],"names":[],"mappings":""}
+38
View File
@@ -0,0 +1,38 @@
/*
* 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 { __awaiter } from "tslib";
import { Recorder } from "@azure-tools/test-recorder";
const replaceableVariables = {
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 = {
envSetupForPlayback: replaceableVariables
};
describe("My test", () => {
let recorder;
beforeEach(function () {
return __awaiter(this, void 0, void 0, function* () {
recorder = new Recorder(this.currentTest);
yield recorder.start(recorderOptions);
});
});
afterEach(function () {
return __awaiter(this, void 0, void 0, function* () {
yield recorder.stop();
});
});
it("sample test", function () {
return __awaiter(this, void 0, void 0, function* () {
console.log("Hi, I'm a test!");
});
});
});
//# sourceMappingURL=sampleTest.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"sampleTest.js","sourceRoot":"","sources":["../../test/sampleTest.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,OAAO,EACL,QAAQ,EAGT,MAAM,4BAA4B,CAAC;AAIpC,MAAM,oBAAoB,GAA2B;IACnD,eAAe,EAAE,iBAAiB;IAClC,mBAAmB,EAAE,qBAAqB;IAC1C,eAAe,EAAE,sCAAsC;IACvD,eAAe,EAAE,uBAAuB;CACzC,CAAC;AAEF,MAAM,eAAe,GAAyB;IAC5C,mBAAmB,EAAE,oBAAoB;CAC1C,CAAC;AAEF,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACvB,IAAI,QAAkB,CAAC;IAEvB,UAAU,CAAC;;YACT,QAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAC1C,MAAM,QAAQ,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QACxC,CAAC;KAAA,CAAC,CAAC;IAEH,SAAS,CAAC;;YACR,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACxB,CAAC;KAAA,CAAC,CAAC;IAEH,EAAE,CAAC,aAAa,EAAE;;YAChB,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QACjC,CAAC;KAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
+4
View File
@@ -0,0 +1,4 @@
export declare const testPollingOptions: {
updateIntervalInMs: number | undefined;
};
//# sourceMappingURL=storage_examples.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"storage_examples.d.ts","sourceRoot":"","sources":["../../test/storage_examples.ts"],"names":[],"mappings":"AA+BA,eAAO,MAAM,kBAAkB;;CAE9B,CAAC"}
+194
View File
@@ -0,0 +1,194 @@
/*
* 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 { __asyncValues, __awaiter } from "tslib";
import { env, Recorder, isPlaybackMode, } from "@azure-tools/test-recorder";
import { createTestCredential } from "@azure-tools/test-credential";
import { assert } from "chai";
import { StorageManagementClient } from "../src/storageManagementClient";
const replaceableVariables = {
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 = {
envSetupForPlayback: replaceableVariables
};
export const testPollingOptions = {
updateIntervalInMs: isPlaybackMode() ? 0 : undefined,
};
describe("Storage test", () => {
let recorder;
let subscriptionId;
let client;
let location;
let resourceGroup;
let storageAccountName;
let containerName;
beforeEach(function () {
return __awaiter(this, void 0, void 0, function* () {
recorder = new Recorder(this.currentTest);
yield recorder.start(recorderOptions);
subscriptionId = env.SUBSCRIPTION_ID || '';
// This is an example of how the environment variables are used
const credential = createTestCredential();
client = new StorageManagementClient(credential, subscriptionId, recorder.configureClientOptions({}));
location = "eastus";
resourceGroup = "myjstest";
storageAccountName = "storageaccountzzzxxx";
containerName = "mycontainerxxx";
});
});
afterEach(function () {
return __awaiter(this, void 0, void 0, function* () {
yield recorder.stop();
});
});
it("storageAccounts create test", function () {
return __awaiter(this, void 0, void 0, function* () {
const res = yield client.storageAccounts.beginCreateAndWait(resourceGroup, storageAccountName, {
sku: {
name: "Standard_GRS",
},
kind: "StorageV2",
location: "westeurope",
encryption: {
services: {
file: {
keyType: "Account",
enabled: true,
},
blob: {
keyType: "Account",
enabled: true,
},
},
keySource: "Microsoft.Storage",
},
tags: {
key1: "value1",
key2: "value2",
}
}, testPollingOptions);
assert.equal(res.name, storageAccountName);
});
});
it("blobContainers create test", function () {
return __awaiter(this, void 0, void 0, function* () {
const res = yield client.blobContainers.create(resourceGroup, storageAccountName, containerName, {});
assert.equal(res.name, containerName);
});
});
it("storageAccounts get test", function () {
return __awaiter(this, void 0, void 0, function* () {
const res = yield client.storageAccounts.getProperties(resourceGroup, storageAccountName);
assert.equal(res.name, storageAccountName);
});
});
it("blobContainers get test", function () {
return __awaiter(this, void 0, void 0, function* () {
const res = yield client.blobContainers.get(resourceGroup, storageAccountName, containerName);
assert.equal(res.name, containerName);
});
});
it("storageAccounts list test", function () {
var e_1, _a;
return __awaiter(this, void 0, void 0, function* () {
const resArray = new Array();
try {
for (var _b = __asyncValues(client.storageAccounts.listByResourceGroup(resourceGroup)), _c; _c = yield _b.next(), !_c.done;) {
let item = _c.value;
resArray.push(item);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
}
finally { if (e_1) throw e_1.error; }
}
assert.equal(resArray.length, 1);
});
});
it("blobContainers list test", function () {
var e_2, _a;
return __awaiter(this, void 0, void 0, function* () {
const resArray = new Array();
try {
for (var _b = __asyncValues(client.blobContainers.list(resourceGroup, storageAccountName)), _c; _c = yield _b.next(), !_c.done;) {
let item = _c.value;
resArray.push(item);
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
}
finally { if (e_2) throw e_2.error; }
}
assert.equal(resArray.length, 1);
});
});
it("storageAccounts update test", function () {
return __awaiter(this, void 0, void 0, function* () {
const res = yield client.storageAccounts.update(resourceGroup, storageAccountName, { tags: { tag1: "value1" } });
assert.equal(res.type, "Microsoft.Storage/storageAccounts");
});
});
it("blobContainers update test", function () {
return __awaiter(this, void 0, void 0, function* () {
const res = yield client.blobContainers.update(resourceGroup, storageAccountName, containerName, {});
assert.equal(res.type, "Microsoft.Storage/storageAccounts/blobServices/containers");
});
});
it("blobContainers delete test", function () {
var e_3, _a;
return __awaiter(this, void 0, void 0, function* () {
const res = yield client.blobContainers.delete(resourceGroup, storageAccountName, containerName);
const resArray = new Array();
try {
for (var _b = __asyncValues(client.blobContainers.list(resourceGroup, storageAccountName)), _c; _c = yield _b.next(), !_c.done;) {
let item = _c.value;
resArray.push(item);
}
}
catch (e_3_1) { e_3 = { error: e_3_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
}
finally { if (e_3) throw e_3.error; }
}
assert.equal(resArray.length, 0);
});
});
it("storageAccounts delete test", function () {
var e_4, _a;
return __awaiter(this, void 0, void 0, function* () {
const res = yield client.storageAccounts.delete(resourceGroup, storageAccountName);
const resArray = new Array();
try {
for (var _b = __asyncValues(client.storageAccounts.listByResourceGroup(resourceGroup)), _c; _c = yield _b.next(), !_c.done;) {
let item = _c.value;
resArray.push(item);
}
}
catch (e_4_1) { e_4 = { error: e_4_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
}
finally { if (e_4) throw e_4.error; }
}
assert.equal(resArray.length, 0);
});
});
});
//# sourceMappingURL=storage_examples.js.map
@@ -0,0 +1 @@
{"version":3,"file":"storage_examples.js","sourceRoot":"","sources":["../../test/storage_examples.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,OAAO,EACL,GAAG,EACH,QAAQ,EAGR,cAAc,GACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAE9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,MAAM,oBAAoB,GAA2B;IACnD,eAAe,EAAE,iBAAiB;IAClC,mBAAmB,EAAE,qBAAqB;IAC1C,eAAe,EAAE,sCAAsC;IACvD,eAAe,EAAE,uBAAuB;CACzC,CAAC;AAEF,MAAM,eAAe,GAAyB;IAC5C,mBAAmB,EAAE,oBAAoB;CAC1C,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,kBAAkB,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;CACrD,CAAC;AAEF,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,IAAI,QAAkB,CAAC;IACvB,IAAI,cAAsB,CAAC;IAC3B,IAAI,MAA+B,CAAC;IACpC,IAAI,QAAgB,CAAC;IACrB,IAAI,aAAqB,CAAC;IAC1B,IAAI,kBAA0B,CAAC;IAC/B,IAAI,aAAqB,CAAC;IAE1B,UAAU,CAAC;;YACT,QAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAC1C,MAAM,QAAQ,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;YACtC,cAAc,GAAG,GAAG,CAAC,eAAe,IAAI,EAAE,CAA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