Skip to content

Commit baf85f4

Browse files
committed
Merge pull request #537
2 parents 558053b + 8946fb8 commit baf85f4

File tree

4 files changed

+83
-105
lines changed

4 files changed

+83
-105
lines changed

tests/GridFS/spec-tests/delete.json

Lines changed: 9 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@
1313
"md5": "d41d8cd98f00b204e9800998ecf8427e",
1414
"filename": "length-0",
1515
"contentType": "application/octet-stream",
16-
"aliases": [
17-
18-
],
19-
"metadata": {
20-
}
16+
"aliases": [],
17+
"metadata": {}
2118
},
2219
{
2320
"_id": {
@@ -31,11 +28,8 @@
3128
"md5": "d41d8cd98f00b204e9800998ecf8427e",
3229
"filename": "length-0-with-empty-chunk",
3330
"contentType": "application/octet-stream",
34-
"aliases": [
35-
36-
],
37-
"metadata": {
38-
}
31+
"aliases": [],
32+
"metadata": {}
3933
},
4034
{
4135
"_id": {
@@ -49,11 +43,8 @@
4943
"md5": "c700ed4fdb1d27055aa3faa2c2432283",
5044
"filename": "length-2",
5145
"contentType": "application/octet-stream",
52-
"aliases": [
53-
54-
],
55-
"metadata": {
56-
}
46+
"aliases": [],
47+
"metadata": {}
5748
},
5849
{
5950
"_id": {
@@ -67,11 +58,8 @@
6758
"md5": "dd254cdc958e53abaa67da9f797125f5",
6859
"filename": "length-8",
6960
"contentType": "application/octet-stream",
70-
"aliases": [
71-
72-
],
73-
"metadata": {
74-
}
61+
"aliases": [],
62+
"metadata": {}
7563
}
7664
],
7765
"chunks": [
@@ -295,22 +283,9 @@
295283
"limit": 1
296284
}
297285
]
298-
},
299-
{
300-
"delete": "expected.chunks",
301-
"deletes": [
302-
{
303-
"q": {
304-
"files_id": {
305-
"$oid": "000000000000000000000004"
306-
}
307-
},
308-
"limit": 0
309-
}
310-
]
311286
}
312287
]
313288
}
314289
}
315290
]
316-
}
291+
}

tests/GridFS/spec-tests/download.json

Lines changed: 60 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@
1313
"md5": "d41d8cd98f00b204e9800998ecf8427e",
1414
"filename": "length-0",
1515
"contentType": "application/octet-stream",
16-
"aliases": [
17-
18-
],
19-
"metadata": {
20-
}
16+
"aliases": [],
17+
"metadata": {}
2118
},
2219
{
2320
"_id": {
@@ -31,11 +28,8 @@
3128
"md5": "d41d8cd98f00b204e9800998ecf8427e",
3229
"filename": "length-0-with-empty-chunk",
3330
"contentType": "application/octet-stream",
34-
"aliases": [
35-
36-
],
37-
"metadata": {
38-
}
31+
"aliases": [],
32+
"metadata": {}
3933
},
4034
{
4135
"_id": {
@@ -49,11 +43,8 @@
4943
"md5": "c700ed4fdb1d27055aa3faa2c2432283",
5044
"filename": "length-2",
5145
"contentType": "application/octet-stream",
52-
"aliases": [
53-
54-
],
55-
"metadata": {
56-
}
46+
"aliases": [],
47+
"metadata": {}
5748
},
5849
{
5950
"_id": {
@@ -67,11 +58,8 @@
6758
"md5": "dd254cdc958e53abaa67da9f797125f5",
6859
"filename": "length-8",
6960
"contentType": "application/octet-stream",
70-
"aliases": [
71-
72-
],
73-
"metadata": {
74-
}
61+
"aliases": [],
62+
"metadata": {}
7563
},
7664
{
7765
"_id": {
@@ -85,11 +73,22 @@
8573
"md5": "57d83cd477bfb1ccd975ab33d827a92b",
8674
"filename": "length-10",
8775
"contentType": "application/octet-stream",
88-
"aliases": [
89-
90-
],
91-
"metadata": {
92-
}
76+
"aliases": [],
77+
"metadata": {}
78+
},
79+
{
80+
"_id": {
81+
"$oid": "000000000000000000000006"
82+
},
83+
"length": 2,
84+
"chunkSize": 4,
85+
"uploadDate": {
86+
"$date": "1970-01-01T00:00:00.000Z"
87+
},
88+
"md5": "c700ed4fdb1d27055aa3faa2c2432283",
89+
"contentType": "application/octet-stream",
90+
"aliases": [],
91+
"metadata": {}
9392
}
9493
],
9594
"chunks": [
@@ -176,6 +175,18 @@
176175
"data": {
177176
"$hex": "99aa"
178177
}
178+
},
179+
{
180+
"_id": {
181+
"$oid": "000000000000000000000008"
182+
},
183+
"files_id": {
184+
"$oid": "000000000000000000000006"
185+
},
186+
"n": 0,
187+
"data": {
188+
"$hex": "1122"
189+
}
179190
}
180191
]
181192
},
@@ -188,8 +199,7 @@
188199
"id": {
189200
"$oid": "000000000000000000000001"
190201
},
191-
"options": {
192-
}
202+
"options": {}
193203
}
194204
},
195205
"assert": {
@@ -206,8 +216,7 @@
206216
"id": {
207217
"$oid": "000000000000000000000002"
208218
},
209-
"options": {
210-
}
219+
"options": {}
211220
}
212221
},
213222
"assert": {
@@ -224,8 +233,7 @@
224233
"id": {
225234
"$oid": "000000000000000000000003"
226235
},
227-
"options": {
228-
}
236+
"options": {}
229237
}
230238
},
231239
"assert": {
@@ -242,8 +250,7 @@
242250
"id": {
243251
"$oid": "000000000000000000000004"
244252
},
245-
"options": {
246-
}
253+
"options": {}
247254
}
248255
},
249256
"assert": {
@@ -260,8 +267,7 @@
260267
"id": {
261268
"$oid": "000000000000000000000005"
262269
},
263-
"options": {
264-
}
270+
"options": {}
265271
}
266272
},
267273
"assert": {
@@ -278,8 +284,7 @@
278284
"id": {
279285
"$oid": "000000000000000000000000"
280286
},
281-
"options": {
282-
}
287+
"options": {}
283288
}
284289
},
285290
"assert": {
@@ -440,6 +445,23 @@
440445
"assert": {
441446
"error": "ChunkIsWrongSize"
442447
}
448+
},
449+
{
450+
"description": "Download legacy file with no name",
451+
"act": {
452+
"operation": "download",
453+
"arguments": {
454+
"id": {
455+
"$oid": "000000000000000000000006"
456+
},
457+
"options": {}
458+
}
459+
},
460+
"assert": {
461+
"result": {
462+
"$hex": "1122"
463+
}
464+
}
443465
}
444466
]
445-
}
467+
}

tests/GridFS/spec-tests/download_by_name.json

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@
1313
"md5": "47ed733b8d10be225eceba344d533586",
1414
"filename": "abc",
1515
"contentType": "application/octet-stream",
16-
"aliases": [
17-
18-
],
19-
"metadata": {
20-
}
16+
"aliases": [],
17+
"metadata": {}
2118
},
2219
{
2320
"_id": {
@@ -31,11 +28,8 @@
3128
"md5": "b15835f133ff2e27c7cb28117bfae8f4",
3229
"filename": "abc",
3330
"contentType": "application/octet-stream",
34-
"aliases": [
35-
36-
],
37-
"metadata": {
38-
}
31+
"aliases": [],
32+
"metadata": {}
3933
},
4034
{
4135
"_id": {
@@ -49,11 +43,8 @@
4943
"md5": "eccbc87e4b5ce2fe28308fd9f2a7baf3",
5044
"filename": "abc",
5145
"contentType": "application/octet-stream",
52-
"aliases": [
53-
54-
],
55-
"metadata": {
56-
}
46+
"aliases": [],
47+
"metadata": {}
5748
},
5849
{
5950
"_id": {
@@ -67,11 +58,8 @@
6758
"md5": "f623e75af30e62bbd73d6df5b50bb7b5",
6859
"filename": "abc",
6960
"contentType": "application/octet-stream",
70-
"aliases": [
71-
72-
],
73-
"metadata": {
74-
}
61+
"aliases": [],
62+
"metadata": {}
7563
},
7664
{
7765
"_id": {
@@ -85,11 +73,8 @@
8573
"md5": "4c614360da93c0a041b22e537de151eb",
8674
"filename": "abc",
8775
"contentType": "application/octet-stream",
88-
"aliases": [
89-
90-
],
91-
"metadata": {
92-
}
76+
"aliases": [],
77+
"metadata": {}
9378
}
9479
],
9580
"chunks": [
@@ -252,4 +237,4 @@
252237
}
253238
}
254239
]
255-
}
240+
}

tests/GridFS/spec-tests/upload.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{
22
"data": {
3-
"files": [
4-
5-
],
6-
"chunks": [
7-
8-
]
3+
"files": [],
4+
"chunks": []
95
},
106
"tests": [
117
{
@@ -388,4 +384,4 @@
388384
}
389385
}
390386
]
391-
}
387+
}

0 commit comments

Comments
 (0)