]> git.openstreetmap.org Git - nominatim.git/blob - tests/features/db/update/linked_places.feature
Merge commit '8c7f8165bdb611f48c0ae63f9318c8490138ffea'
[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 sending query "foo" with dups
25         Then results contain
26          | osm_type
27          | N
28
29     Scenario: Add linked place when linking relation is removed
30         Given the place nodes
31             | osm_id | class | type | name | geometry
32             | 1      | place | city | foo  | 0 0
33         And the place areas
34             | osm_type | osm_id | class    | type           | name | admin_level | geometry
35             | R        | 1      | boundary | administrative | foo  | 8           | poly-area:0.1
36         When importing
37         And sending query "foo" with dups
38         Then results contain
39          | osm_type
40          | R
41         When marking for delete R1
42         Then table placex contains
43          | object | linked_place_id
44          | N1     | None
45         And sending query "foo" with dups
46         Then results contain
47          | osm_type
48          | N
49
50     Scenario: Remove linked place when linking relation is added
51         Given the place nodes
52             | osm_id | class | type | name | geometry
53             | 1      | place | city | foo  | 0 0
54         When importing
55         And sending query "foo" with dups
56         Then results contain
57          | osm_type
58          | N
59         When updating place areas
60          | osm_type | osm_id | class    | type           | name   | admin_level | geometry
61          | R        | 1      | boundary | administrative | foo    | 8           | poly-area:0.1
62         Then table placex contains
63          | object | linked_place_id
64          | N1     | R1
65         When sending query "foo" with dups
66         Then results contain
67          | osm_type
68          | R
69
70     Scenario: Remove linked place when linking relation is renamed
71         Given the place nodes
72             | osm_id | class | type | name | geometry
73             | 1      | place | city | foo  | 0 0
74         And the place areas
75          | osm_type | osm_id | class    | type           | name   | admin_level | geometry
76          | R        | 1      | boundary | administrative | foobar | 8           | poly-area:0.1
77         When importing
78         And sending query "foo" with dups
79         Then results contain
80          | osm_type
81          | N
82         When updating place areas
83          | osm_type | osm_id | class    | type           | name   | admin_level | geometry
84          | R        | 1      | boundary | administrative | foo    | 8           | poly-area:0.1
85         Then table placex contains
86          | object | linked_place_id
87          | N1     | R1
88         When sending query "foo" with dups
89         Then results contain
90          | osm_type
91          | R
92