diff --git a/setup.py b/setup.py index feba18a722fdadcbef21b65aa228e252bb334a37..e4eecb9b8257dcf1dd4cde8b224c194e83ca5986 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ from setuptools import setup, find_packages -tests_require = ["pytest"] +tests_require = ["pytest", "pytest-asyncio"] linters_require = ["pylint", "pre-commit"] setup( diff --git a/tests/config.yml b/tests/config.yml new file mode 100644 index 0000000000000000000000000000000000000000..fcc161166802e4a95645c7d66454eb19fdf761a8 --- /dev/null +++ b/tests/config.yml @@ -0,0 +1,7 @@ +overpass_base_url: https://overpass.openbuildingmap.org/api +filepath: ./tests/data/ +state_filename: state.txt +rabotnik: + hostname: localhost + username: user + password: password diff --git a/tests/test_configure.py b/tests/test_configure.py new file mode 100644 index 0000000000000000000000000000000000000000..742814112d245569637a6302bf75f498df48399b --- /dev/null +++ b/tests/test_configure.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 + +# Copyright (C) 2021: +# Helmholtz-Zentrum Potsdam Deutsches GeoForschungsZentrum GFZ +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or (at +# your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero +# General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. + +import logging + +from spearhead.configure import Configuration + +logger = logging.getLogger() + + +def test_configuration_init(): + + config = Configuration("tests/config.yml") + assert config + assert config.state_filename == "state.txt" + assert config.rabotnik["hostname"] == "localhost"