File: download_by_name.yml

package info (click to toggle)
golang-mongodb-mongo-driver 1.8.4%2Bds1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-backports
  • size: 18,520 kB
  • sloc: perl: 533; ansic: 491; python: 432; makefile: 187; sh: 72
file content (113 lines) | stat: -rw-r--r-- 4,144 bytes parent folder | download | duplicates (2)
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
data:
    files:
        -
            _id: { "$oid" : "000000000000000000000001" }
            length: 1
            chunkSize: 4
            uploadDate: { "$date" : "1970-01-01T00:00:00.000Z" }
            md5: "47ed733b8d10be225eceba344d533586"
            filename: "abc"
            contentType: "application/octet-stream"
            aliases: []
            metadata: {}
        -
            _id: { "$oid" : "000000000000000000000002" }
            length: 1
            chunkSize: 4
            uploadDate: { "$date" : "1970-01-02T00:00:00.000Z" }
            md5: "b15835f133ff2e27c7cb28117bfae8f4"
            filename: "abc"
            contentType: "application/octet-stream"
            aliases: []
            metadata: {}
        -
            _id: { "$oid" : "000000000000000000000003" }
            length: 1
            chunkSize: 4
            uploadDate: { "$date" : "1970-01-03T00:00:00.000Z" }
            md5: "eccbc87e4b5ce2fe28308fd9f2a7baf3"
            filename: "abc"
            contentType: "application/octet-stream"
            aliases: []
            metadata: {}
        -
            _id: { "$oid" : "000000000000000000000004" }
            length: 1
            chunkSize: 4
            uploadDate: { "$date" : "1970-01-04T00:00:00.000Z" }
            md5: "f623e75af30e62bbd73d6df5b50bb7b5"
            filename: "abc"
            contentType: "application/octet-stream"
            aliases: []
            metadata: {}
        -
            _id: { "$oid" : "000000000000000000000005" }
            length: 1
            chunkSize: 4
            uploadDate: { "$date" : "1970-01-05T00:00:00.000Z" }
            md5: "4c614360da93c0a041b22e537de151eb"
            filename: "abc"
            contentType: "application/octet-stream"
            aliases: []
            metadata: {}
    chunks:
        - { _id : { "$oid" : "000000000000000000000001" }, files_id : { "$oid" : "000000000000000000000001" }, n : 0, data : { $hex : "11" } }
        - { _id : { "$oid" : "000000000000000000000002" }, files_id : { "$oid" : "000000000000000000000002" }, n : 0, data : { $hex : "22" } }
        - { _id : { "$oid" : "000000000000000000000003" }, files_id : { "$oid" : "000000000000000000000003" }, n : 0, data : { $hex : "33" } }
        - { _id : { "$oid" : "000000000000000000000004" }, files_id : { "$oid" : "000000000000000000000004" }, n : 0, data : { $hex : "44" } }
        - { _id : { "$oid" : "000000000000000000000005" }, files_id : { "$oid" : "000000000000000000000005" }, n : 0, data : { $hex : "55" } }

tests:
    -
        description: "Download_by_name when revision is 0"
        act:
            operation: download_by_name
            arguments:
                filename: "abc"
                options: { revision : 0 }
        assert:
            result: { $hex : "11" }
    -
        description: "Download_by_name when revision is 1"
        act:
            operation: download_by_name
            arguments:
                filename: "abc"
                options: { revision : 1 }
        assert:
            result: { $hex : "22" }
    -
        description: "Download_by_name when revision is -2"
        act:
            operation: download_by_name
            arguments:
                filename: "abc"
                options: { revision : -2 }
        assert:
            result: { $hex : "44" }
    -
        description: "Download_by_name when revision is -1"
        act:
            operation: download_by_name
            arguments:
                filename: "abc"
                options: { revision : -1 }
        assert:
            result: { $hex : "55" }
    -
        description: "Download_by_name when files entry does not exist"
        act:
            operation: download_by_name
            arguments:
                filename: "xyz"
        assert:
            error: "FileNotFound"
    -
        description: "Download_by_name when revision does not exist"
        act:
            operation: download_by_name
            arguments:
                filename: "abc"
                options: { revision : 999 }
        assert:
            error: "RevisionNotFound"