tests for signal penalty. renamed 'given the nodes' to 'given the node map' and introduced new 'given the nodes' to set node tags

This commit is contained in:
Emil Tin
2012-03-08 08:37:41 +01:00
parent a65339d011
commit 9dfbd5f671
14 changed files with 162 additions and 52 deletions
+99
View File
@@ -0,0 +1,99 @@
@routing @penalty
Feature: Penalties
Background:
Given the speedprofile "bicycle"
And the speedprofile settings
| trafficSignalPenalty | 20 |
Scenario: Passing a traffic signal should incur a delay
Given the node map
| a | b | c |
| d | e | f |
And the nodes
| node | highway |
| e | traffic_signals |
And the ways
| nodes |
| abc |
| def |
When I route I should get
| from | to | route | time |
| a | c | abc | 38s |
| d | f | def | 58s |
Scenario: Passing multiple traffic signals should incur a accumulated delay
Given the node map
| a | b | c | d | e |
And the nodes
| node | highway |
| b | traffic_signals |
| c | traffic_signals |
| d | traffic_signals |
And the ways
| nodes |
| abcde |
When I route I should get
| from | to | route | time |
| a | e | abcde | 136s |
Scenario: Starting or ending at a traffic signal should not incur a delay
Given the node map
| a | b | c |
And the nodes
| node | highway |
| b | traffic_signals |
And the ways
| nodes |
| abc |
When I route I should get
| from | to | route | time |
| a | b | abc | 19s |
| b | a | abc | 19s |
| b | c | abc | 19s |
| c | b | abc | 19s |
Scenario: Routing between signals on the same way should not incur a delay
Given the node map
| a | b | c | d |
And the nodes
| node | highway |
| a | traffic_signals |
| d | traffic_signals |
And the ways
| nodes |
| abcd |
When I route I should get
| from | to | route | time |
| b | c | abcd | 19s |
| c | b | abcd | 19s |
Scenario: Prefer faster route without traffic signals
Given the node map
| a | b | c |
| | d | |
And the nodes
| node | highway |
| b | traffic_signals |
And the ways
| nodes |
| abc |
| adc |
When I route I should get
| from | to | route |
| a | c | adc |