X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/65bd749918e2368c0f9f14a696bbec473de21530..73953cbac95847740339d7a5ee3c0e5f142d93c5:/test/python/test_tools_refresh.py diff --git a/test/python/test_tools_refresh.py b/test/python/test_tools_refresh.py index b472ee30..ac79a48f 100644 --- a/test/python/test_tools_refresh.py +++ b/test/python/test_tools_refresh.py @@ -7,20 +7,18 @@ import pytest from nominatim.tools import refresh -TEST_DIR = (Path(__file__) / '..' / '..').resolve() - def test_refresh_import_wikipedia_not_existing(dsn): - assert 1 == refresh.import_wikipedia_articles(dsn, Path('.')) + assert refresh.import_wikipedia_articles(dsn, Path('.')) == 1 @pytest.mark.parametrize("replace", (True, False)) -def test_refresh_import_wikipedia(dsn, table_factory, temp_db_cursor, replace): +def test_refresh_import_wikipedia(dsn, src_dir, table_factory, temp_db_cursor, replace): if replace: table_factory('wikipedia_article') table_factory('wikipedia_redirect') # use the small wikipedia file for the API testdb - assert 0 == refresh.import_wikipedia_articles(dsn, TEST_DIR / 'testdb') + assert refresh.import_wikipedia_articles(dsn, src_dir / 'test' / 'testdb') == 0 assert temp_db_cursor.table_rows('wikipedia_article') > 0 assert temp_db_cursor.table_rows('wikipedia_redirect') > 0