add test for inserts with multiple mappings

master
Oliver Tonnhofer 2014-08-04 15:19:20 +02:00
parent 0807c33eaa
commit 8ad4c8f1d2
2 changed files with 22 additions and 0 deletions

View File

@ -761,6 +761,20 @@
<tag k="landuse" v="park"/>
</relation>
<!-- test way with multiple mappings is inserted twice -->
<node id="18001" version="1" timestamp="2011-11-11T00:11:11Z" lat="11" lon="89"/>
<node id="18002" version="1" timestamp="2011-11-11T00:11:11Z" lat="11" lon="90"/>
<node id="18003" version="1" timestamp="2011-11-11T00:11:11Z" lat="14" lon="90"/>
<node id="18004" version="1" timestamp="2011-11-11T00:11:11Z" lat="14" lon="89"/>
<way id="18001" version="1" timestamp="2011-11-11T00:11:11Z">
<nd ref="18001"/>
<nd ref="18002"/>
<nd ref="18003"/>
<tag k="name" v="way 18001"/>
<tag k="highway" v="residential"/>
<tag k="railway" v="tram"/>
</way>
<!-- test that node (n:20001) does not reference way (w:20001) after it was deleted -->
<node id="20001" version="1" timestamp="2011-11-11T00:11:11Z" lat="30" lon="10">

View File

@ -110,6 +110,14 @@ def test_broken_multipolygon_ways():
assert t.query_row(t.db_conf, 'osm_roads', 17101)['type'] == 'residential'
assert t.query_row(t.db_conf, 'osm_roads', 17102) == None
def test_node_way_inserted_twice():
"""Way with multiple mappings is inserted twice in same table"""
rows = t.query_row(t.db_conf, 'osm_roads', 18001)
rows.sort(key=lambda x: x['type'])
assert rows[0]['type'] == 'residential'
assert rows[1]['type'] == 'tram'
def test_node_way_ref_after_delete_1():
"""Nodes refereces way"""
data = t.cache_query(nodes=[20001, 20002], deps=True)