test: replace raw execute() with fixture code where possible

This commit is contained in:
Sarah Hoffmann
2021-05-19 12:11:04 +02:00
parent 65bd749918
commit c06a1d007a
15 changed files with 128 additions and 186 deletions

View File

@@ -244,9 +244,9 @@ def test_add_data_command(mock_run_legacy, name, oid):
(['--boundaries-only'], 1, 0),
(['--no-boundaries'], 0, 1),
(['--boundaries-only', '--no-boundaries'], 0, 0)])
def test_index_command(mock_func_factory, temp_db_cursor, tokenizer_mock,
def test_index_command(mock_func_factory, table_factory, tokenizer_mock,
params, do_bnds, do_ranks):
temp_db_cursor.execute("CREATE TABLE import_status (indexed bool)")
table_factory('import_status', 'indexed bool')
bnd_mock = mock_func_factory(nominatim.indexer.indexer.Indexer, 'index_boundaries')
rank_mock = mock_func_factory(nominatim.indexer.indexer.Indexer, 'index_by_rank')