Skip to content

Commit

Permalink
Rewrite tests for the zip renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
cslzchen committed Apr 16, 2018
1 parent 81aa3a2 commit b220f96
Show file tree
Hide file tree
Showing 11 changed files with 440 additions and 149 deletions.
Empty file removed tests/extensions/zip/__init__.py
Empty file.
Binary file removed tests/extensions/zip/files/empty.zip
Binary file not shown.
Binary file removed tests/extensions/zip/files/test-tree.zip
Binary file not shown.
Binary file removed tests/extensions/zip/files/test.zip
Binary file not shown.
Binary file added tests/extensions/zip/files/zip-empty.zip
Binary file not shown.
Binary file added tests/extensions/zip/files/zip-test.zip
Binary file not shown.
117 changes: 0 additions & 117 deletions tests/extensions/zip/fixtures/fixtures.json

This file was deleted.

22 changes: 22 additions & 0 deletions tests/extensions/zip/fixtures/obj_list.json
@@ -0,0 +1,22 @@
{
"test_file_list": [
"zip-test/",
"zip-test/file-generic-ext.mfr",
"zip-test/folder-3/",
"zip-test/folder-3/folder-3-1/",
"zip-test/folder-3/folder-3-1/text-3.docx",
"zip-test/folder-3/folder-3-1/folder-3-1-1/",
"zip-test/folder-3/folder-3-1/folder-3-1-1/image-3.bmp",
"zip-test/folder-2/",
"zip-test/folder-2/text-2.pdf",
"zip-test/folder-2/folder-2-1/",
"zip-test/folder-2/folder-2-1/image-2.jpg",
"zip-test/file-no-ext",
"zip-test/folder-1/",
"zip-test/folder-1/text-1.txt",
"zip-test/folder-1/image-1.png"
],
"empty_file_list": [
"zip-empty/"
]
}
169 changes: 169 additions & 0 deletions tests/extensions/zip/fixtures/obj_tree.json
@@ -0,0 +1,169 @@
{
"test_file_tree": [
{
"icon": "http://mfr.osf.io/assets/zip/img/file-ext-zip.png",
"text": "test.zip",
"children": [
{
"icon": "http://mfr.osf.io/assets/zip/img/folder.png",
"text": "zip-test",
"data": {
"size": "",
"date": "2018-04-16 11:52:50"
},
"children": [
{
"icon": "http://mfr.osf.io/assets/zip/img/file-ext-generic.png",
"text": "file-generic-ext.mfr",
"data": {
"size": " 29B",
"date": "2018-03-27 15:42:32"
},
"children": []
},
{
"icon": "http://mfr.osf.io/assets/zip/img/folder.png",
"text": "folder-3",
"data": {
"size": "",
"date": "2018-04-16 17:07:48"
},
"children": [
{
"icon": "http://mfr.osf.io/assets/zip/img/folder.png",
"text": "folder-3-1",
"data": {
"size": "",
"date": "2018-04-16 11:56:56"
},
"children": [
{
"icon": "http://mfr.osf.io/assets/zip/img/file-ext-docx.png",
"text": "text-3.docx",
"data": {
"size": " 19B",
"date": "2018-03-27 15:42:32"
},
"children": []
},
{
"icon": "http://mfr.osf.io/assets/zip/img/folder.png",
"text": "folder-3-1-1",
"data": {
"size": "",
"date": "2018-04-16 11:57:12"
},
"children": [
{
"icon": "http://mfr.osf.io/assets/zip/img/file-ext-bmp.png",
"text": "image-3.bmp",
"data": {
"size": " 17B",
"date": "2018-03-27 15:42:32"
},
"children": []
}
]
}
]
}
]
},
{
"icon": "http://mfr.osf.io/assets/zip/img/folder.png",
"text": "folder-2",
"data": {
"size": "",
"date": "2018-04-16 11:56:50"
},
"children": [
{
"icon": "http://mfr.osf.io/assets/zip/img/file-ext-pdf.png",
"text": "text-2.pdf",
"data": {
"size": " 37B",
"date": "2018-03-27 15:42:32"
},
"children": []
},
{
"icon": "http://mfr.osf.io/assets/zip/img/folder.png",
"text": "folder-2-1",
"data": {
"size": "",
"date": "2018-04-16 11:56:56"
},
"children": [
{
"icon": "http://mfr.osf.io/assets/zip/img/file-ext-jpg.png",
"text": "image-2.jpg",
"data": {
"size": " 26B",
"date": "2018-03-27 15:42:32"
},
"children": []
}
]
}
]
},
{
"icon": "http://mfr.osf.io/assets/zip/img/file-ext-generic.png",
"text": "file-no-ext",
"data": {
"size": " 19B",
"date": "2018-03-27 15:42:32"
},
"children": []
},
{
"icon": "http://mfr.osf.io/assets/zip/img/folder.png",
"text": "folder-1",
"data": {
"size": "",
"date": "2018-04-16 11:50:48"
},
"children": [
{
"icon": "http://mfr.osf.io/assets/zip/img/file-ext-txt.png",
"text": "text-1.txt",
"data": {
"size": " 35B",
"date": "2018-03-27 15:42:32"
},
"children": []
},
{
"icon": "http://mfr.osf.io/assets/zip/img/file-ext-png.png",
"text": "image-1.png",
"data": {
"size": " 19B",
"date": "2018-03-27 15:42:32"
},
"children": []
}
]
}
]
}
]
}
],
"empty_file_tree": [
{
"text": "test.zip",
"icon": "http://mfr.osf.io/assets/zip/img/file-ext-zip.png",
"children": [
{
"text": "zip-empty",
"icon": "http://mfr.osf.io/assets/zip/img/folder.png",
"data": {
"date": "2018-04-16 11:53:50",
"size": ""
},
"children": []
}
]
}
]
}

0 comments on commit b220f96

Please sign in to comment.