mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-14 18:37:58 +00:00
port wikipedia importance functions to python
This commit is contained in:
@@ -71,6 +71,12 @@ def temp_db(monkeypatch):
|
||||
|
||||
conn.close()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def dsn(temp_db):
|
||||
return 'dbname=' + temp_db
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def temp_db_with_extensions(temp_db):
|
||||
conn = psycopg2.connect(database=temp_db)
|
||||
@@ -101,6 +107,14 @@ def temp_db_cursor(temp_db):
|
||||
conn.close()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def table_factory(temp_db_cursor):
|
||||
def mk_table(name, definition='id INT'):
|
||||
temp_db_cursor.execute('CREATE TABLE {} ({})'.format(name, definition))
|
||||
|
||||
return mk_table
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def def_config():
|
||||
return Configuration(None, SRC_DIR.resolve() / 'settings')
|
||||
|
||||
Reference in New Issue
Block a user