MCPcopy
hub / github.com/simstudioai/sim / test

Function test

apps/sim/lib/data-drains/destinations/azure_blob.ts:147–167  ·  view source on GitHub ↗
({ config, credentials, signal })

Source from the content-addressed store, hash-verified

145 credentialsSchema: azureBlobCredentialsSchema,
146
147 async test({ config, credentials, signal }) {
148 const { containerClient } = await buildClients(config, credentials)
149 const probeName = `${normalizePrefix(config.prefix)}.sim-drain-write-probe/${generateShortId(12)}`
150 const blockBlobClient = containerClient.getBlockBlobClient(probeName)
151 await withAzureErrorContext('test-put', () =>
152 blockBlobClient.upload(Buffer.alloc(0), 0, {
153 blobHTTPHeaders: { blobContentType: 'application/octet-stream' },
154 abortSignal: signal,
155 })
156 )
157 try {
158 await blockBlobClient.deleteIfExists({ abortSignal: signal })
159 } catch (cleanupError) {
160 logger.debug('Azure Blob test write probe cleanup failed (non-fatal)', {
161 accountName: config.accountName,
162 containerName: config.containerName,
163 blobName: probeName,
164 error: cleanupError,
165 })
166 }
167 },
168
169 openSession({ config, credentials }) {
170 let clientsPromise: Promise<BlobClients> | null = null

Callers

nothing calls this directly

Calls 5

normalizePrefixFunction · 0.90
generateShortIdFunction · 0.90
buildClientsFunction · 0.85
withAzureErrorContextFunction · 0.85
debugMethod · 0.80

Tested by

no test coverage detected