Buffersize test fixed to test PostGIS and mapnik MVT paths

This commit is contained in:
David M 2017-10-09 15:42:24 +02:00
parent 6af83d7630
commit 1766cd0ad4

View File

@ -3,6 +3,7 @@ require('../support/test_helper');
var fs = require('fs');
var assert = require('../support/assert');
var TestClient = require('../support/test-client');
var serverOptions = require('../../lib/cartodb/server_options');
var mapnik = require('windshaft').mapnik;
var IMAGE_TOLERANCE_PER_MIL = 5;
@ -131,7 +132,16 @@ describe('buffer size per format', function () {
return done();
});
const originalUsePostGIS = serverOptions.renderer.mvt.usePostGIS;
testCases.forEach(function (test) {
var testFn = (usePostGIS) => {
before(function () {
serverOptions.renderer.mvt.usePostGIS = usePostGIS;
});
after(function () {
serverOptions.renderer.mvt.usePostGIS = originalUsePostGIS;
});
it(test.desc, function (done) {
this.testClient = new TestClient(test.mapConfig, 1234);
var coords = test.coords;
@ -146,6 +156,11 @@ describe('buffer size per format', function () {
test.assert(tile, done);
});
});
};
if (test.format === 'mvt'){
testFn(true);
}
testFn(false);
});
});
@ -431,7 +446,15 @@ describe('buffer size per format for named maps w/o placeholders', function () {
return done();
});
const originalUsePostGIS = serverOptions.renderer.mvt.usePostGIS;
testCases.forEach(function (test) {
var testFn = (usePostGIS) => {
before(function () {
serverOptions.renderer.mvt.usePostGIS = usePostGIS;
});
after(function () {
serverOptions.renderer.mvt.usePostGIS = originalUsePostGIS;
});
it(test.desc, function (done) {
this.testClient = new TestClient(test.template, 1234);
var coords = test.coords;
@ -449,5 +472,10 @@ describe('buffer size per format for named maps w/o placeholders', function () {
test.assert(tile, done);
});
});
};
if (test.format === 'mvt'){
testFn(true);
}
testFn(false);
});
});