2 Test for various refresh functions.
4 from pathlib import Path
8 from nominatim.tools import refresh
10 def test_refresh_import_wikipedia_not_existing(dsn):
11 assert refresh.import_wikipedia_articles(dsn, Path('.')) == 1
14 @pytest.mark.parametrize("replace", (True, False))
15 def test_refresh_import_wikipedia(dsn, src_dir, table_factory, temp_db_cursor, replace):
17 table_factory('wikipedia_article')
18 table_factory('wikipedia_redirect')
20 # use the small wikipedia file for the API testdb
21 assert refresh.import_wikipedia_articles(dsn, src_dir / 'test' / 'testdb') == 0
23 assert temp_db_cursor.table_rows('wikipedia_article') > 0
24 assert temp_db_cursor.table_rows('wikipedia_redirect') > 0