INNER CODE UNIT · Go

TestBucketOpenDownloadStreamMissing

256dpi/lungo · bucket_test.go:149

func TestBucketOpenDownloadStreamMissing(t *testing.T) {
	bucketTest(t, 0, func(t *testing.T, b *Bucket) {
		stream, err := b.OpenDownloadStream(nil, primitive.NewObjectID())
		assert.Equal(t, ErrFileNotFound, err)
		assert.Nil(t, stream)

		stream, err = b.OpenDownloadStreamByName(nil, "missing")
		assert.Equal(t, ErrFileNotFound, err)
		assert.Nil(t, stream)
	})
}

func TestBucketDeleteOrphanChunks(t *testing.T) {
	bucketTest(t, 0, func(t *testing.T, b *Bucket) {
		id, err := b.UploadFromStream(nil, "foo", strings.NewReader("Hello World!"))
		assert.NoError(t, err)

		// remove only the files row, leaving chunks behind

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…