Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Dynamic Exposure
OpenBuildingMap
spearhead
Commits
458cdc50
Commit
458cdc50
authored
Nov 01, 2021
by
Felix Delattre
Browse files
Added tests for configuration handling
parent
4f9f4459
Pipeline
#29728
passed with stage
in 1 minute and 19 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
setup.py
View file @
458cdc50
...
...
@@ -18,7 +18,7 @@
from
setuptools
import
setup
,
find_packages
tests_require
=
[
"pytest"
]
tests_require
=
[
"pytest"
,
"pytest-asyncio"
]
linters_require
=
[
"pylint"
,
"pre-commit"
]
setup
(
...
...
tests/config.yml
0 → 100644
View file @
458cdc50
overpass_base_url
:
https://overpass.openbuildingmap.org/api
filepath
:
./tests/data/
state_filename
:
state.txt
rabotnik
:
hostname
:
localhost
username
:
user
password
:
password
tests/test_configure.py
0 → 100644
View file @
458cdc50
#!/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"
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment