2 Test for various refresh functions.
4 from pathlib import Path
8 from nominatim.tools import refresh
10 TEST_DIR = (Path(__file__) / '..' / '..').resolve()
12 def test_refresh_import_wikipedia_not_existing(dsn):
13 assert 1 == refresh.import_wikipedia_articles(dsn, Path('.'))
16 @pytest.mark.parametrize("replace", (True, False))
17 def test_refresh_import_wikipedia(dsn, table_factory, temp_db_cursor, replace):
19 table_factory('wikipedia_article')
20 table_factory('wikipedia_redirect')
22 # use the small wikipedia file for the API testdb
23 assert 0 == refresh.import_wikipedia_articles(dsn, TEST_DIR / 'testdb')
25 assert temp_db_cursor.scalar('SELECT count(*) FROM wikipedia_article') > 0
26 assert temp_db_cursor.scalar('SELECT count(*) FROM wikipedia_redirect') > 0