mirror of
https://github.com/BOSWatch/BW3-Core.git
synced 2026-04-06 06:43:54 +00:00
move test files - fix config tests
This commit is contained in:
parent
82e3eb719d
commit
2ca62d90f2
17 changed files with 97 additions and 110 deletions
|
|
@ -16,6 +16,7 @@
|
|||
"""
|
||||
import logging
|
||||
import yaml
|
||||
import yaml.parser
|
||||
|
||||
logging.debug("- %s loaded", __name__)
|
||||
|
||||
|
|
@ -46,9 +47,11 @@ class ConfigYAML:
|
|||
# use safe_load instead load
|
||||
self._config = yaml.safe_load(file)
|
||||
return True
|
||||
except: # pragma: no cover
|
||||
logging.exception("cannot load config file")
|
||||
return False
|
||||
except FileNotFoundError:
|
||||
logging.error("config file not found: %s", configPath)
|
||||
except yaml.parser.ParserError:
|
||||
logging.exception("error in config file")
|
||||
return False
|
||||
|
||||
def get(self, *args, default=None):
|
||||
tmp = self._config
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue