From 93ada250f774d8bc521af56cedf7e34b548d64dd Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Mon, 14 Nov 2022 17:27:04 +0100 Subject: [PATCH] bdd: add tests for osm2pgsql update of postcode nodes --- test/bdd/osm2pgsql/update/postcodes.feature | 163 ++++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 test/bdd/osm2pgsql/update/postcodes.feature diff --git a/test/bdd/osm2pgsql/update/postcodes.feature b/test/bdd/osm2pgsql/update/postcodes.feature new file mode 100644 index 00000000..23f86f76 --- /dev/null +++ b/test/bdd/osm2pgsql/update/postcodes.feature @@ -0,0 +1,163 @@ +@DB +Feature: Update of postcode only objects + Tests that changes to objects containing only a postcode are + propagated correctly. + + + Scenario: Adding a postcode-only node + When loading osm data + """ + """ + Then place contains exactly + | object | + + When updating osm data + """ + n34 Tpostcode=4456 + """ + Then place contains exactly + | object | type | + | N34:place | postcode | + When indexing + Then placex contains exactly + | object | + + + Scenario: Deleting a postcode-only node + When loading osm data + """ + n34 Tpostcode=4456 + """ + Then place contains exactly + | object | type | + | N34:place | postcode | + + When updating osm data + """ + n34 v2 dD + """ + Then place contains exactly + | object | + When indexing + Then placex contains exactly + | object | + + + Scenario Outline: Converting a regular object into a postcode-only node + When loading osm data + """ + n34 T= + """ + Then place contains exactly + | object | type | + | N34: | | + + When updating osm data + """ + n34 Tpostcode=4456 + """ + Then place contains exactly + | object | type | + | N34:place | postcode | + When indexing + Then placex contains exactly + | object | + + Examples: + | class | type | + | amenity | restaurant | + | place | hamlet | + + + Scenario Outline: Converting a postcode-only node into a regular object + When loading osm data + """ + n34 Tpostcode=4456 + """ + Then place contains exactly + | object | type | + | N34:place | postcode | + + When updating osm data + """ + n34 T= + """ + Then place contains exactly + | object | type | + | N34: | | + When indexing + Then placex contains exactly + | object | type | + | N34: | | + + Examples: + | class | type | + | amenity | restaurant | + | place | hamlet | + + + Scenario: Converting na interpolation into a postcode-only node + Given the grid + | 1 | 2 | + When loading osm data + """ + n1 Taddr:housenumber=3 + n2 Taddr:housenumber=17 + w34 Taddr:interpolation=odd Nn1,n2 + """ + Then place contains exactly + | object | type | + | N1:place | house | + | N2:place | house | + | W34:place | houses | + + When updating osm data + """ + w34 Tpostcode=4456 Nn1,n2 + """ + Then place contains exactly + | object | type | + | N1:place | house | + | N2:place | house | + | W34:place | postcode | + When indexing + Then location_property_osmline contains exactly + | object | + And placex contains exactly + | object | type | + | N1:place | house | + | N2:place | house | + + + Scenario: Converting a postcode-only node into an interpolation + Given the grid + | 1 | 2 | + When loading osm data + """ + n1 Taddr:housenumber=3 + n2 Taddr:housenumber=17 + w34 Tpostcode=4456 Nn1,n2 + """ + Then place contains exactly + | object | type | + | N1:place | house | + | N2:place | house | + | W34:place | postcode | + + When updating osm data + """ + w34 Taddr:interpolation=odd Nn1,n2 + """ + Then place contains exactly + | object | type | + | N1:place | house | + | N2:place | house | + | W34:place | houses | + When indexing + Then location_property_osmline contains exactly + | object | + | 34:5 | + And placex contains exactly + | object | type | + | N1:place | house | + | N2:place | house | -- 2.39.5