Validate image from analysis

This commit is contained in:
Raul Ochoa
2016-03-14 16:16:27 +01:00
parent a05f3d6ee9
commit 4924bcc298
2 changed files with 7 additions and 5 deletions
+7 -5
View File
@@ -6,6 +6,7 @@ var dot = require('dot');
describe('analysis-layers', function() {
var IMAGE_TOLERANCE_PER_MIL = 20;
var multitypeStyleTemplate = dot.template([
"#points['mapnik::geometry_type'=1] {",
@@ -86,7 +87,7 @@ describe('analysis-layers', function() {
}
];
useCases.forEach(function(useCase, imageIdx) {
useCases.forEach(function(useCase) {
it('should implement use case: "' + useCase.desc + '"', function(done) {
var testClient = new TestClient(useCase.mapConfig, 1234);
@@ -96,11 +97,12 @@ describe('analysis-layers', function() {
testClient.getTile(tile.z, tile.x, tile.y, function(err, res, image) {
assert.ok(!err, err);
image.save('/tmp/tests/' + imageIdx + '---' + useCase.desc.replace(/\s/g, '-') + '.png');
var fixturePath = './test/fixtures/analysis/basic-source-id-mapnik-layer.png';
assert.imageIsSimilarToFile(image, fixturePath, IMAGE_TOLERANCE_PER_MIL, function(err) {
assert.ok(!err, err);
assert.equal(image.width(), 256);
testClient.drain(done);
testClient.drain(done);
});
});
});
});
Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB