Cucumber test support for alternatives count parameter
This commit is contained in:
parent
5be6f8959a
commit
421d336b0f
@ -39,7 +39,8 @@ module.exports = function () {
|
|||||||
duration = '',
|
duration = '',
|
||||||
annotation = '',
|
annotation = '',
|
||||||
geometry = '',
|
geometry = '',
|
||||||
OSMIDs = '';
|
OSMIDs = '',
|
||||||
|
alternatives = '';
|
||||||
|
|
||||||
|
|
||||||
if (res.statusCode === 200) {
|
if (res.statusCode === 200) {
|
||||||
@ -95,6 +96,10 @@ module.exports = function () {
|
|||||||
if (json.matchings.length != 1) throw new Error('*** Checking geometry only supported for matchings with one subtrace');
|
if (json.matchings.length != 1) throw new Error('*** Checking geometry only supported for matchings with one subtrace');
|
||||||
geometry = json.matchings[0].geometry;
|
geometry = json.matchings[0].geometry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (headers.has('alternatives')) {
|
||||||
|
alternatives = this.alternativesList(json);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (headers.has('turns')) {
|
if (headers.has('turns')) {
|
||||||
@ -137,6 +142,9 @@ module.exports = function () {
|
|||||||
got['OSM IDs'] = OSMIDs;
|
got['OSM IDs'] = OSMIDs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (headers.has('alternatives')) {
|
||||||
|
got['alternatives'] = alternatives;
|
||||||
|
}
|
||||||
var ok = true;
|
var ok = true;
|
||||||
var encodedResult = '',
|
var encodedResult = '',
|
||||||
extendedTarget = '';
|
extendedTarget = '';
|
||||||
|
@ -180,6 +180,11 @@ module.exports = function () {
|
|||||||
return merged;
|
return merged;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.alternativesList = (instructions) => {
|
||||||
|
// alternatives_count come from tracepoints list
|
||||||
|
return instructions.tracepoints.map(t => t.alternatives_count.toString()).join(',');
|
||||||
|
};
|
||||||
|
|
||||||
this.lanesList = (instructions) => {
|
this.lanesList = (instructions) => {
|
||||||
return this.extractInstructionList(instructions, instruction => {
|
return this.extractInstructionList(instructions, instruction => {
|
||||||
if( 'lanes' in instruction.intersections[0] )
|
if( 'lanes' in instruction.intersections[0] )
|
||||||
|
@ -263,6 +263,22 @@ Feature: Basic Map Matching
|
|||||||
| trace | matchings | geometry |
|
| trace | matchings | geometry |
|
||||||
| abd | abd | 1,1,1,1.00009,1,1.00009,0.99991,1.00009 |
|
| abd | abd | 1,1,1,1.00009,1,1.00009,0.99991,1.00009 |
|
||||||
|
|
||||||
|
Scenario: Testbot - Matching alternatives count test
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a b c d e f
|
||||||
|
g h i
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | oneway |
|
||||||
|
| abcdef | yes |
|
||||||
|
| dghi | yes |
|
||||||
|
|
||||||
|
When I match I should get
|
||||||
|
| trace | matchings | alternatives |
|
||||||
|
| abcdef | abcde | 1,1,1,1,2,2 |
|
||||||
|
|
||||||
Scenario: Testbot - Speed greater than speed threshhold
|
Scenario: Testbot - Speed greater than speed threshhold
|
||||||
Given a grid size of 10 meters
|
Given a grid size of 10 meters
|
||||||
Given the query options
|
Given the query options
|
||||||
|
Loading…
Reference in New Issue
Block a user