1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
|
description: "gridfs-upload-disableMD5"
schemaVersion: "1.0"
createEntities:
- client:
id: &client0 client0
- database:
id: &database0 database0
client: *client0
databaseName: &database0Name gridfs-tests
- bucket:
id: &bucket0 bucket0
database: *database0
- collection:
id: &bucket0_files_collection bucket0_files_collection
database: *database0
collectionName: &bucket0_files_collectionName fs.files
- collection:
id: &bucket0_chunks_collection bucket0_chunks_collection
database: *database0
collectionName: &bucket0_chunks_collectionName fs.chunks
initialData:
- collectionName: *bucket0_files_collectionName
databaseName: *database0Name
documents: []
- collectionName: *bucket0_chunks_collectionName
databaseName: *database0Name
documents: []
# Note: these tests utilize the transitional "disableMD5" option. Drivers that
# do not support the option should skip this file.
tests:
- description: "upload when length is 0 sans MD5"
operations:
- name: upload
object: *bucket0
arguments:
filename: "filename"
source: { $$hexBytes: "" }
chunkSizeBytes: 4
disableMD5: true
expectResult: { $$type: objectId }
saveResultAsEntity: &uploadedObjectId uploadedObjectId
- name: find
object: *bucket0_files_collection
arguments:
filter: {}
expectResult:
- _id: { $$matchesEntity: *uploadedObjectId }
length: 0
chunkSize: 4
uploadDate: { $$type: date }
md5: { $$exists: false }
filename: filename
- name: find
object: *bucket0_chunks_collection
arguments:
filter: {}
expectResult: []
- description: "upload when length is 1 sans MD5"
operations:
- name: upload
object: *bucket0
arguments:
filename: "filename"
source: { $$hexBytes: "11" }
chunkSizeBytes: 4
disableMD5: true
expectResult: { $$type: objectId }
saveResultAsEntity: *uploadedObjectId
- name: find
object: *bucket0_files_collection
arguments:
filter: {}
expectResult:
- _id: { $$matchesEntity: *uploadedObjectId }
length: 1
chunkSize: 4
uploadDate: { $$type: date }
md5: { $$exists: false }
filename: filename
- name: find
object: *bucket0_chunks_collection
arguments:
filter: {}
expectResult:
- _id: { $$type: objectId }
files_id: { $$matchesEntity: *uploadedObjectId }
n: 0
data: { $binary: { base64: "EQ==", subType: "00" } } # hex 11
|