]> git.openstreetmap.org Git - nominatim.git/blob - tests/features/db/update/linked_places.feature
Merge remote-tracking branch 'origin/master' into osmline
[nominatim.git] / tests / features / db / update / linked_places.feature
1 @DB
2 Feature: Updates of linked places
3     Tests that linked places are correctly added and deleted.
4     
5
6     Scenario: Add linked place when linking relation is renamed
7         Given the place nodes
8             | osm_id | class | type | name | geometry
9             | 1      | place | city | foo  | 0 0
10         And the place areas
11             | osm_type | osm_id | class    | type           | name | admin_level | geometry
12             | R        | 1      | boundary | administrative | foo  | 8           | poly-area:0.1
13         When importing
14         And sending query "foo" with dups
15         Then results contain
16          | osm_type
17          | R
18         When updating place areas
19          | osm_type | osm_id | class    | type           | name   | admin_level | geometry
20          | R        | 1      | boundary | administrative | foobar | 8           | poly-area:0.1
21         Then table placex contains
22          | object | linked_place_id
23          | N1     | None
24         When updating place areas
25          | osm_type | osm_id | class    | type           | name   | admin_level | geometry
26         When sending query "foo" with dups
27         Then results contain
28          | osm_type
29          | N
30
31     Scenario: Add linked place when linking relation is removed
32         Given the place nodes
33             | osm_id | class | type | name | geometry
34             | 1      | place | city | foo  | 0 0
35         And the place areas
36             | osm_type | osm_id | class    | type           | name | admin_level | geometry
37             | R        | 1      | boundary | administrative | foo  | 8           | poly-area:0.1
38         When importing
39         And sending query "foo" with dups
40         Then results contain
41          | osm_type
42          | R
43         When marking for delete R1
44         Then table placex contains
45          | object | linked_place_id
46          | N1     | None
47         When updating place areas
48          | osm_type | osm_id | class    | type           | name   | admin_level | geometry
49         And sending query "foo" with dups
50         Then results contain
51          | osm_type
52          | N
53
54     Scenario: Remove linked place when linking relation is added
55         Given the place nodes
56             | osm_id | class | type | name | geometry
57             | 1      | place | city | foo  | 0 0
58         When importing
59         And sending query "foo" with dups
60         Then results contain
61          | osm_type
62          | N
63         When updating place areas
64          | osm_type | osm_id | class    | type           | name   | admin_level | geometry
65          | R        | 1      | boundary | administrative | foo    | 8           | poly-area:0.1
66         Then table placex contains
67          | object | linked_place_id
68          | N1     | R1
69         When sending query "foo" with dups
70         Then results contain
71          | osm_type
72          | R
73
74     Scenario: Remove linked place when linking relation is renamed
75         Given the place nodes
76             | osm_id | class | type | name | geometry
77             | 1      | place | city | foo  | 0 0
78         And the place areas
79          | osm_type | osm_id | class    | type           | name   | admin_level | geometry
80          | R        | 1      | boundary | administrative | foobar | 8           | poly-area:0.1
81         When importing
82         And sending query "foo" with dups
83         Then results contain
84          | osm_type
85          | N
86         When updating place areas
87          | osm_type | osm_id | class    | type           | name   | admin_level | geometry
88          | R        | 1      | boundary | administrative | foo    | 8           | poly-area:0.1
89         Then table placex contains
90          | object | linked_place_id
91          | N1     | R1
92         When sending query "foo" with dups
93         Then results contain
94          | osm_type
95          | R
96