]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/features/db/update/entrances.feature
Merge pull request #3859 from lonvia/fix-entrance-addresses
[nominatim.git] / test / bdd / features / db / update / entrances.feature
1 Feature: Entrance nodes are recorded
2     Test that updated entrance nodes are saved
3
4     Scenario: A building with a newly tagged entrance
5         Given the grid
6           | 1 | 2 |
7           | 4 | 3 |
8         Given the places
9           | osm  | class    | type  | geometry    |
10           | W1   | building | yes   | (1,2,3,4,1) |
11         And the ways
12           | id | nodes         |
13           | 1  | 1, 2, 3, 4, 1 |
14         When importing
15         Then placex contains exactly
16          | object | place_id |
17          | W1     | 1        |
18         Then placex_entrance contains exactly
19          | place_id | osm_id | type | location!wkt | extratags |
20         When updating entrances
21           | osm | type  | geometry    |
22           | N1  | main  | 1           |
23         And updating places
24           | osm  | class    | type  | geometry    |
25           | W1   | building | yes   | (1,2,3,4,1) |
26         Then placex contains exactly
27          | object | place_id |
28          | W1     | 1        |
29         Then placex_entrance contains exactly
30          | place_id | osm_id | type | location!wkt | extratags |
31          | 1        | 1      | main | 1            | -         |
32
33     Scenario: A building with a updated entrance node
34         Given the grid
35           | 1 | 2 |
36           | 4 | 3 |
37         Given the places
38           | osm | class    | type  | geometry    |
39           | N1  | barrier  | gate  | 1           |
40           | W1  | building | yes   | (1,2,3,4,1) |
41         And the ways
42           | id | nodes         |
43           | 1  | 1, 2, 3, 4, 1 |
44         When importing
45         Then placex contains exactly
46          | object | place_id |
47          | N1     | 1        |
48          | W1     | 2        |
49         Then placex_entrance contains exactly
50          | place_id | osm_id | type | location!wkt | extratags |
51         When marking for delete N1
52         And updating entrances
53           | osm | type  | geometry    |
54           | N1  | main  | 1           |
55         And updating places
56           | osm | class    | type  | geometry    |
57           | W1  | building | yes   | (1,2,3,4,1) |
58         Then placex contains exactly
59          | object | place_id |
60          | W1     | 2        |
61         And placex_entrance contains exactly
62          | place_id | osm_id | type | location!wkt | extratags |
63          | 2        | 1      | main | 1            | -         |
64
65     Scenario: A building with a removed entrance
66         Given the grid
67           | 1 | 2 |
68           | 4 | 3 |
69         Given the places
70           | osm | class    | type  | geometry    |
71           | W1  | building | yes   | (1,2,3,4,1) |
72         And the entrances
73           | osm | type  | geometry    |
74           | N1  | main  | 1           |
75         And the ways
76           | id | nodes         |
77           | 1  | 1, 2, 3, 4, 1 |
78         When importing
79         Then placex contains exactly
80          | object | place_id |
81          | W1     | 1        |
82         And placex_entrance contains exactly
83          | place_id | osm_id | type | location!wkt | extratags |
84          | 1        | 1      | main | 1            | -         |
85         When marking for delete N1
86         And updating places
87           | osm | class    | type  | geometry  |
88           | W1  | building | yes   | (1,2,3,4,1) |
89         Then placex contains exactly
90          | object | place_id |
91          | W1     | 1        |
92         And placex_entrance contains exactly
93          | place_id | osm_id | type | location!wkt | extratags |
94
95     Scenario: A building with a removed and remaining entrance
96         Given the grid
97           | 1 | 2 |
98           | 4 | 3 |
99         Given the places
100           | osm | class    | type  | geometry    |
101           | W1  | building | yes   | (1,2,3,4,1) |
102         Given the entrances
103           | osm | type  | geometry    |
104           | N1  | main  | 1           |
105           | N3  | yes   | 3           |
106         And the ways
107           | id | nodes         |
108           | 1  | 1, 2, 3, 4, 1 |
109         When importing
110         Then placex contains exactly
111          | object | place_id |
112          | W1     | 1        |
113         And placex_entrance contains exactly
114          | place_id | osm_id | type | location!wkt | extratags |
115          | 1        | 1      | main | 1            | -         |
116          | 1        | 3      | yes  | 3            | -         |
117         When marking for delete N1
118         And updating places
119           | osm | class    | type  | geometry  |
120           | W1  | building | yes   | (1,2,3,4,1) |
121         Then placex contains exactly
122          | object | place_id |
123          | W1     | 1        |
124         And placex_entrance contains exactly
125          | place_id | osm_id | type | location!wkt | extratags |
126          | 1        | 3      | yes  | 3            | -         |