-
Notifications
You must be signed in to change notification settings - Fork 3
/
test_imagemap.py
33 lines (30 loc) · 1.1 KB
/
test_imagemap.py
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
from imagemap import ImageMap
def test_imagemap():
imagemap = ImageMap({
"images": {
"example": [
"/a.jpg",
"/b.png",
"/a.gif",
"/b.gifv",
],
"hidden": [
"/a.jpg",
]
},
"aliases": {
"example": ["alias", "other_alias"]
},
"hidden": ["hidden"]
}, {
"extensions": ["jpg", "jpeg", "png", "bmp", "tif", "gif", "gifv","avi"],
"animated_extensions": ["gif","avi","gifv"],
"switchable_extensions": ["jpeg","jpg","gif","png"],
})
assert imagemap.get("example") == (["/a.jpg", "/b.png", "/a.gif", "/b.gifv"], "example")
assert imagemap.get("alias") == (["/a.jpg", "/b.png", "/a.gif", "/b.gifv"], "example")
assert imagemap.get("other_alias") == (["/a.jpg", "/b.png", "/a.gif", "/b.gifv"], "example")
assert imagemap.get("exmple") == (["/a.jpg", "/b.png", "/a.gif", "/b.gifv"], "example")
assert imagemap.get("example", "jpg") == (["/a.jpg"], "example")
assert imagemap.get("example", "jpeg") == (["/a.jpeg", "/b.jpeg"], "example")
assert imagemap.get("example", "avi") == (["/a.gif", "/b.gifv"], "example")