vector timeout error tests

This commit is contained in:
Simon Martín 2017-11-07 11:08:01 +01:00
parent 216c877f4b
commit cda9a09b8e
2 changed files with 18 additions and 16 deletions

View File

@ -411,7 +411,7 @@ describe('user database timeout limit', function () {
this.testClient.setUserDatabaseTimeoutLimit(0, done);
});
it('"mvt" fails due to statement timeout', function (done) {
it('"mvt" fails due to statement timeout', function (done) {
const params = {
layergroupid: this.layergroupid,
format: 'mvt',
@ -419,18 +419,23 @@ describe('user database timeout limit', function () {
response: {
status: 429,
headers: {
'Content-Type': 'application/json; charset=utf-8'
'Content-Type': 'application/x-protobuf'
}
}
};
this.testClient.getTile(0, 0, 0, params, (err, res, timeoutError) => {
this.testClient.getTile(0, 0, 0, params, (err, res, tile) => {
assert.ifError(err);
assert.deepEqual(timeoutError, DATASOURCE_TIMEOUT_ERROR);
var tileJSON = tile.toJSON();
assert.equal(Array.isArray(tileJSON), true);
assert.equal(tileJSON.length, 2);
assert.equal(tileJSON[0].name, 'errorTileSquareLayer');
assert.equal(tileJSON[1].name, 'errorTileStripesLayer');
done();
});
});
});
});

View File

@ -232,7 +232,7 @@ describe('user render timeout limit', function () {
response: {
status: 429,
headers: {
'Content-Type': 'application/json; charset=utf-8'
'Content-Type': 'application/x-protobuf'
}
}
};
@ -240,15 +240,12 @@ describe('user render timeout limit', function () {
this.testClient.getTile(0, 0, 0, params, (err, res, tile) => {
assert.ifError(err);
assert.deepEqual(tile, {
errors: ['You are over platform\'s limits. Please contact us to know more details'],
errors_with_context: [{
type: 'limit',
subtype: 'datasource',
message: 'You are over platform\'s limits. Please contact us to know more details'
}]
});
var tileJSON = tile.toJSON();
assert.equal(Array.isArray(tileJSON), true);
assert.equal(tileJSON.length, 2);
assert.equal(tileJSON[0].name, 'errorTileSquareLayer');
assert.equal(tileJSON[1].name, 'errorTileStripesLayer');
done();
});
});