]> git.openstreetmap.org Git - nominatim.git/blobdiff - tests/steps/db_setup.py
Merge branch 'tigerlines' of https://github.com/markigail/Nominatim
[nominatim.git] / tests / steps / db_setup.py
index e1315ed95a74f65dbe9c2ab7cd994d4d3d9b24be..23d526f87847c756268c5ffcdf2f4baf42b161b2 100644 (file)
@@ -184,9 +184,9 @@ def import_fill_planet_osm_rels(step):
         if not members:
             members = None
 
-        cur.execute("""INSERT INTO planet_osm_rels 
-                      (id, way_off, rel_off, parts, members, tags, pending)
-                      VALUES (%s, %s, %s, %s, %s, %s, false)""",
+        cur.execute("""INSERT INTO planet_osm_rels
+                      (id, way_off, rel_off, parts, members, tags)
+                      VALUES (%s, %s, %s, %s, %s, %s)""",
                    (line['id'], len(parts['n']), len(parts['n']) + len(parts['w']),
                    parts['n'] + parts['w'] + parts['r'], members, tags))
     world.conn.commit()
@@ -202,9 +202,8 @@ def import_fill_planet_osm_ways(step):
             tags = None
         nodes = [int(x.strip()) for x in line['nodes'].split(',')]
 
-        cur.execute("""INSERT INTO planet_osm_ways
-                       (id, nodes, tags, pending)
-                       VALUES (%s, %s, %s, false)""",
+        cur.execute("""INSERT INTO planet_osm_ways (id, nodes, tags)
+                       VALUES (%s, %s, %s)""",
                     (line['id'], nodes, tags))
     world.conn.commit()
 
@@ -266,10 +265,12 @@ def query_cmd(step, query, with_dups):
            '--search', query]
     if with_dups is not None:
         cmd.append('--nodedupe')
-    proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+    proc = subprocess.Popen(cmd, cwd=world.config.source_dir,
+                            stdout=subprocess.PIPE, stderr=subprocess.PIPE)
     (outp, err) = proc.communicate()
     assert (proc.returncode == 0), "query.php failed with message: %s" % err
     world.page = outp
-    world.response_format = 'json'   
+    world.response_format = 'json'
+    world.request_type = 'search'
     world.returncode = 200