Skip to content

Commit 0e698c2

Browse files
committed
Rewrite tests for the zip renderer
1 parent 8f27ae3 commit 0e698c2

File tree

11 files changed

+440
-149
lines changed

11 files changed

+440
-149
lines changed

tests/extensions/zip/__init__.py

Whitespace-only changes.

tests/extensions/zip/files/empty.zip

-22 Bytes
Binary file not shown.
-6.62 KB
Binary file not shown.

tests/extensions/zip/files/test.zip

-4.08 KB
Binary file not shown.
146 Bytes
Binary file not shown.
7.85 KB
Binary file not shown.

tests/extensions/zip/fixtures/fixtures.json

Lines changed: 0 additions & 117 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"test_file_list": [
3+
"zip-test/",
4+
"zip-test/file-generic-ext.mfr",
5+
"zip-test/folder-3/",
6+
"zip-test/folder-3/folder-3-1/",
7+
"zip-test/folder-3/folder-3-1/text-3.docx",
8+
"zip-test/folder-3/folder-3-1/folder-3-1-1/",
9+
"zip-test/folder-3/folder-3-1/folder-3-1-1/image-3.bmp",
10+
"zip-test/folder-2/",
11+
"zip-test/folder-2/text-2.pdf",
12+
"zip-test/folder-2/folder-2-1/",
13+
"zip-test/folder-2/folder-2-1/image-2.jpg",
14+
"zip-test/file-no-ext",
15+
"zip-test/folder-1/",
16+
"zip-test/folder-1/text-1.txt",
17+
"zip-test/folder-1/image-1.png"
18+
],
19+
"empty_file_list": [
20+
"zip-empty/"
21+
]
22+
}
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
{
2+
"test_file_tree": [
3+
{
4+
"icon": "http://mfr.osf.io/assets/zip/img/file-ext-zip.png",
5+
"text": "test.zip",
6+
"children": [
7+
{
8+
"icon": "http://mfr.osf.io/assets/zip/img/folder.png",
9+
"text": "zip-test",
10+
"data": {
11+
"size": "",
12+
"date": "2018-04-16 11:52:50"
13+
},
14+
"children": [
15+
{
16+
"icon": "http://mfr.osf.io/assets/zip/img/file-ext-generic.png",
17+
"text": "file-generic-ext.mfr",
18+
"data": {
19+
"size": " 29B",
20+
"date": "2018-03-27 15:42:32"
21+
},
22+
"children": []
23+
},
24+
{
25+
"icon": "http://mfr.osf.io/assets/zip/img/folder.png",
26+
"text": "folder-3",
27+
"data": {
28+
"size": "",
29+
"date": "2018-04-16 17:07:48"
30+
},
31+
"children": [
32+
{
33+
"icon": "http://mfr.osf.io/assets/zip/img/folder.png",
34+
"text": "folder-3-1",
35+
"data": {
36+
"size": "",
37+
"date": "2018-04-16 11:56:56"
38+
},
39+
"children": [
40+
{
41+
"icon": "http://mfr.osf.io/assets/zip/img/file-ext-docx.png",
42+
"text": "text-3.docx",
43+
"data": {
44+
"size": " 19B",
45+
"date": "2018-03-27 15:42:32"
46+
},
47+
"children": []
48+
},
49+
{
50+
"icon": "http://mfr.osf.io/assets/zip/img/folder.png",
51+
"text": "folder-3-1-1",
52+
"data": {
53+
"size": "",
54+
"date": "2018-04-16 11:57:12"
55+
},
56+
"children": [
57+
{
58+
"icon": "http://mfr.osf.io/assets/zip/img/file-ext-bmp.png",
59+
"text": "image-3.bmp",
60+
"data": {
61+
"size": " 17B",
62+
"date": "2018-03-27 15:42:32"
63+
},
64+
"children": []
65+
}
66+
]
67+
}
68+
]
69+
}
70+
]
71+
},
72+
{
73+
"icon": "http://mfr.osf.io/assets/zip/img/folder.png",
74+
"text": "folder-2",
75+
"data": {
76+
"size": "",
77+
"date": "2018-04-16 11:56:50"
78+
},
79+
"children": [
80+
{
81+
"icon": "http://mfr.osf.io/assets/zip/img/file-ext-pdf.png",
82+
"text": "text-2.pdf",
83+
"data": {
84+
"size": " 37B",
85+
"date": "2018-03-27 15:42:32"
86+
},
87+
"children": []
88+
},
89+
{
90+
"icon": "http://mfr.osf.io/assets/zip/img/folder.png",
91+
"text": "folder-2-1",
92+
"data": {
93+
"size": "",
94+
"date": "2018-04-16 11:56:56"
95+
},
96+
"children": [
97+
{
98+
"icon": "http://mfr.osf.io/assets/zip/img/file-ext-jpg.png",
99+
"text": "image-2.jpg",
100+
"data": {
101+
"size": " 26B",
102+
"date": "2018-03-27 15:42:32"
103+
},
104+
"children": []
105+
}
106+
]
107+
}
108+
]
109+
},
110+
{
111+
"icon": "http://mfr.osf.io/assets/zip/img/file-ext-generic.png",
112+
"text": "file-no-ext",
113+
"data": {
114+
"size": " 19B",
115+
"date": "2018-03-27 15:42:32"
116+
},
117+
"children": []
118+
},
119+
{
120+
"icon": "http://mfr.osf.io/assets/zip/img/folder.png",
121+
"text": "folder-1",
122+
"data": {
123+
"size": "",
124+
"date": "2018-04-16 11:50:48"
125+
},
126+
"children": [
127+
{
128+
"icon": "http://mfr.osf.io/assets/zip/img/file-ext-txt.png",
129+
"text": "text-1.txt",
130+
"data": {
131+
"size": " 35B",
132+
"date": "2018-03-27 15:42:32"
133+
},
134+
"children": []
135+
},
136+
{
137+
"icon": "http://mfr.osf.io/assets/zip/img/file-ext-png.png",
138+
"text": "image-1.png",
139+
"data": {
140+
"size": " 19B",
141+
"date": "2018-03-27 15:42:32"
142+
},
143+
"children": []
144+
}
145+
]
146+
}
147+
]
148+
}
149+
]
150+
}
151+
],
152+
"empty_file_tree": [
153+
{
154+
"text": "test.zip",
155+
"icon": "http://mfr.osf.io/assets/zip/img/file-ext-zip.png",
156+
"children": [
157+
{
158+
"text": "zip-empty",
159+
"icon": "http://mfr.osf.io/assets/zip/img/folder.png",
160+
"data": {
161+
"date": "2018-04-16 11:53:50",
162+
"size": ""
163+
},
164+
"children": []
165+
}
166+
]
167+
}
168+
]
169+
}

0 commit comments

Comments
 (0)