X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/6f03a4d6ce89c88d285e9e6884a330cd3a32d5f0..2fac507453ca5d50ecc8ccd4f8d66aa0b8954c18:/test/python/config/test_config.py diff --git a/test/python/config/test_config.py b/test/python/config/test_config.py index 69ad01ac..a9cbb48d 100644 --- a/test/python/config/test_config.py +++ b/test/python/config/test_config.py @@ -1,3 +1,9 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# This file is part of Nominatim. (https://nominatim.org) +# +# Copyright (C) 2022 by the Nominatim developer community. +# For a full list of authors see the git log. """ Test for loading dotenv configuration. """ @@ -167,6 +173,23 @@ def test_get_int_empty(make_config): config.get_int('DATABASE_MODULE_PATH') +@pytest.mark.parametrize("value,outlist", [('sd', ['sd']), + ('dd,rr', ['dd', 'rr']), + (' a , b ', ['a', 'b'])]) +def test_get_str_list_success(make_config, monkeypatch, value, outlist): + config = make_config() + + monkeypatch.setenv('NOMINATIM_MYLIST', value) + + assert config.get_str_list('MYLIST') == outlist + + +def test_get_str_list_empty(make_config): + config = make_config() + + assert config.get_str_list('LANGUAGES') is None + + def test_get_path_empty(make_config): config = make_config()