[render-test] Add more probe tests for file size
Also make the tests simpler.
|
Before Width: | Height: | Size: 686 B After Width: | Height: | Size: 169 B |
@@ -0,0 +1 @@
|
||||
{"fileSize":[["image","foo.123",442],["style","bar.321",609]]}
|
||||
@@ -3,8 +3,8 @@
|
||||
"metadata": {
|
||||
"test": {
|
||||
"operations": [
|
||||
["probeFileSize", "style", "aaaaa.json"],
|
||||
["probeFileSize", "image", "bbbbb.png"]
|
||||
["probeFileSize", "style", "style.json"],
|
||||
["probeFileSize", "image", "expected.png"]
|
||||
],
|
||||
"width": 64,
|
||||
"height": 64
|
||||
@@ -22,15 +22,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"sprite": "local://sprites/sprite",
|
||||
"layers": [
|
||||
{
|
||||
"id": "symbol",
|
||||
"type": "symbol",
|
||||
"source": "geojson",
|
||||
"layout": {
|
||||
"icon-image": "circle-12"
|
||||
}
|
||||
"id": "circle",
|
||||
"type": "circle",
|
||||
"source": "geojson"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
BIN
render-test/tests/filesize/fail-file-not-found/expected.png
Normal file
|
After Width: | Height: | Size: 169 B |
32
render-test/tests/filesize/fail-file-not-found/style.json
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"version": 8,
|
||||
"metadata": {
|
||||
"test": {
|
||||
"operations": [
|
||||
["probeFileSize", "style", "style.aaaa"],
|
||||
["probeFileSize", "image", "expected.bbb"]
|
||||
],
|
||||
"width": 64,
|
||||
"height": 64
|
||||
}
|
||||
},
|
||||
"sources": {
|
||||
"geojson": {
|
||||
"type": "geojson",
|
||||
"data": {
|
||||
"type": "Point",
|
||||
"coordinates": [
|
||||
0,
|
||||
0
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"layers": [
|
||||
{
|
||||
"id": "circle",
|
||||
"type": "circle",
|
||||
"source": "geojson"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Before Width: | Height: | Size: 686 B After Width: | Height: | Size: 169 B |
@@ -22,15 +22,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"sprite": "local://sprites/sprite",
|
||||
"layers": [
|
||||
{
|
||||
"id": "symbol",
|
||||
"type": "symbol",
|
||||
"source": "geojson",
|
||||
"layout": {
|
||||
"icon-image": "circle-12"
|
||||
}
|
||||
"id": "circle",
|
||||
"type": "circle",
|
||||
"source": "geojson"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 686 B After Width: | Height: | Size: 169 B |
@@ -22,15 +22,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"sprite": "local://sprites/sprite",
|
||||
"layers": [
|
||||
{
|
||||
"id": "symbol",
|
||||
"type": "symbol",
|
||||
"source": "geojson",
|
||||
"layout": {
|
||||
"icon-image": "circle-12"
|
||||
}
|
||||
"id": "circle",
|
||||
"type": "circle",
|
||||
"source": "geojson"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 686 B After Width: | Height: | Size: 169 B |
@@ -1 +1 @@
|
||||
{"fileSize":[["image","expected.png",686],["style","style.json",609]]}
|
||||
{"fileSize":[["image","expected.png",169],["style","style.json",510]]}
|
||||
@@ -22,15 +22,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"sprite": "local://sprites/sprite",
|
||||
"layers": [
|
||||
{
|
||||
"id": "symbol",
|
||||
"type": "symbol",
|
||||
"source": "geojson",
|
||||
"layout": {
|
||||
"icon-image": "circle-12"
|
||||
}
|
||||
"id": "circle",
|
||||
"type": "circle",
|
||||
"source": "geojson"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"tests/filesize/fail-size-is-over": "Should fail, size is bigger than expected.",
|
||||
"tests/filesize/fail-size-is-under": "Should fail, size is smaller than expected.",
|
||||
"tests/filesize/fail-file-doesnt-match": "Should fail, file not found."
|
||||
"tests/filesize/fail-file-doesnt-match": "Should fail, doesn't match the expectation.",
|
||||
"tests/filesize/fail-file-not-found": "Should fail, file not found."
|
||||
}
|
||||
|
||||