|
|
@@ -480,7 +480,7 @@ describe('BlobStore', function () {
|
|
|
})
|
|
|
|
|
|
describe('copyBlob method', function () {
|
|
|
- it('copies a binary blob to another project', async function () {
|
|
|
+ it('copies a binary blob to another project in the same backend', async function () {
|
|
|
const testFile = 'graph.png'
|
|
|
const originalHash = testFiles.GRAPH_PNG_HASH
|
|
|
const insertedBlob = await blobStore.putFile(testFiles.path(testFile))
|
|
|
@@ -493,7 +493,7 @@ describe('BlobStore', function () {
|
|
|
expect(copiedBlob.getStringLength()).to.be.null
|
|
|
})
|
|
|
|
|
|
- it('copies a text blob to another project', async function () {
|
|
|
+ it('copies a text blob to another project in the same backend', async function () {
|
|
|
const insertedBlob = await blobStore.putString(helloWorldString)
|
|
|
await blobStore.copyBlob(insertedBlob, scenario.projectId2)
|
|
|
const copiedBlob = await blobStore2.getBlob(helloWorldHash)
|
|
|
@@ -502,6 +502,41 @@ describe('BlobStore', function () {
|
|
|
expect(content).to.equal(helloWorldString)
|
|
|
})
|
|
|
})
|
|
|
+
|
|
|
+ describe('copyBlob method with different backends', function () {
|
|
|
+ const otherScenario = scenarios.find(
|
|
|
+ s => s.backend !== scenario.backend
|
|
|
+ )
|
|
|
+ const otherBlobStore = new BlobStore(otherScenario.projectId2)
|
|
|
+
|
|
|
+ beforeEach(async function () {
|
|
|
+ await otherBlobStore.initialize()
|
|
|
+ })
|
|
|
+
|
|
|
+ it('copies a binary blob to another project in a different backend', async function () {
|
|
|
+ const testFile = 'graph.png'
|
|
|
+ const originalHash = testFiles.GRAPH_PNG_HASH
|
|
|
+ const insertedBlob = await blobStore.putFile(testFiles.path(testFile))
|
|
|
+ await blobStore.copyBlob(insertedBlob, otherScenario.projectId2)
|
|
|
+ const copiedBlob = await otherBlobStore.getBlob(originalHash)
|
|
|
+ expect(copiedBlob).to.exist
|
|
|
+ expect(copiedBlob.getHash()).to.equal(originalHash)
|
|
|
+ expect(copiedBlob.getByteLength()).to.equal(
|
|
|
+ insertedBlob.getByteLength()
|
|
|
+ )
|
|
|
+ expect(copiedBlob.getStringLength()).to.be.null
|
|
|
+ })
|
|
|
+
|
|
|
+ it('copies a text blob to another project in a different backend', async function () {
|
|
|
+ const insertedBlob = await blobStore.putString(helloWorldString)
|
|
|
+ await blobStore.copyBlob(insertedBlob, otherScenario.projectId2)
|
|
|
+ const copiedBlob = await otherBlobStore.getBlob(helloWorldHash)
|
|
|
+ expect(copiedBlob).to.exist
|
|
|
+ expect(copiedBlob.getHash()).to.equal(helloWorldHash)
|
|
|
+ const content = await otherBlobStore.getString(helloWorldHash)
|
|
|
+ expect(content).to.equal(helloWorldString)
|
|
|
+ })
|
|
|
+ })
|
|
|
})
|
|
|
}
|
|
|
|