[render-test] Add more probe tests for file size

Also make the tests simpler.
This commit is contained in:
Thiago Marcos P. Santos
2019-10-11 16:52:22 +03:00
parent 7f5c630613
commit acd7fba3d5
13 changed files with 50 additions and 32 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 686 B

After

Width:  |  Height:  |  Size: 169 B

View File

@@ -0,0 +1 @@
{"fileSize":[["image","foo.123",442],["style","bar.321",609]]}

View File

@@ -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"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

View 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"
}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 686 B

After

Width:  |  Height:  |  Size: 169 B

View File

@@ -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"
}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 686 B

After

Width:  |  Height:  |  Size: 169 B

View File

@@ -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"
}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 686 B

After

Width:  |  Height:  |  Size: 169 B

View File

@@ -1 +1 @@
{"fileSize":[["image","expected.png",686],["style","style.json",609]]}
{"fileSize":[["image","expected.png",169],["style","style.json",510]]}

View File

@@ -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"
}
]
}

View File

@@ -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."
}