mirror of
https://github.com/BOSWatch/BW3-Core.git
synced 2026-04-05 14:25:45 +00:00
fix test config file location and paths
This commit is contained in:
parent
2ca62d90f2
commit
4b69b08028
7 changed files with 45 additions and 38 deletions
|
|
@ -15,9 +15,8 @@
|
|||
@description: Unittests for BOSWatch. File have to run as "pytest" unittest
|
||||
"""
|
||||
import logging
|
||||
from typing import Dict
|
||||
|
||||
import pytest
|
||||
from boswatch.utils import paths
|
||||
|
||||
from boswatch.configYaml import ConfigYAML
|
||||
|
||||
|
|
@ -34,23 +33,23 @@ def getConfig():
|
|||
@pytest.fixture
|
||||
def getFilledConfig():
|
||||
filledConfig = ConfigYAML()
|
||||
filledConfig.loadConfigFile("test_config.yaml")
|
||||
assert filledConfig.loadConfigFile(paths.TEST_PATH + "test_config.yaml") is True
|
||||
return filledConfig
|
||||
|
||||
|
||||
def test_loadConfigFile(getConfig):
|
||||
"""!load a local config file"""
|
||||
assert getConfig.loadConfigFile("test_config.yaml") is True
|
||||
"""!load a config file"""
|
||||
assert getConfig.loadConfigFile(paths.TEST_PATH + "test_config.yaml") is True
|
||||
|
||||
|
||||
def test_loadConfigFileFailed(getConfig):
|
||||
"""!load a local config file with syntax error"""
|
||||
assert getConfig.loadConfigFile("test_configFailed.yaml") is False
|
||||
"""!load a config file with syntax error"""
|
||||
assert getConfig.loadConfigFile(paths.TEST_PATH + "test_configFailed.yaml") is False
|
||||
|
||||
|
||||
def test_loadConfigFileNotFound(getConfig):
|
||||
"""!load a local config file where is not available"""
|
||||
assert getConfig.loadConfigFile("test_configNotFound.yaml") is False
|
||||
"""!load a config file where is not available"""
|
||||
assert getConfig.loadConfigFile(paths.TEST_PATH + "test_configNotFound.yaml") is False
|
||||
|
||||
|
||||
def test_getTypes(getFilledConfig):
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
types:
|
||||
string: Hello World
|
||||
bool: true
|
||||
integer: 11
|
||||
float: 3.14
|
||||
|
||||
list:
|
||||
- one
|
||||
- two
|
||||
- three
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
types:
|
||||
string: Hello World
|
||||
boolean: true
|
||||
integer: 11
|
||||
float: 3.14
|
||||
21
test/test_config.yaml
Normal file
21
test/test_config.yaml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# ____ ____ ______ __ __ __ _____
|
||||
# / __ )/ __ \/ ___/ | / /___ _/ /______/ /_ |__ /
|
||||
# / __ / / / /\__ \| | /| / / __ `/ __/ ___/ __ \ /_ <
|
||||
# / /_/ / /_/ /___/ /| |/ |/ / /_/ / /_/ /__/ / / / ___/ /
|
||||
#/_____/\____//____/ |__/|__/\__,_/\__/\___/_/ /_/ /____/
|
||||
# German BOS Information Script
|
||||
#
|
||||
|
||||
# for the test_config
|
||||
types:
|
||||
string: Hello World
|
||||
bool: true
|
||||
integer: 11
|
||||
float: 3.14
|
||||
|
||||
# for the test_config
|
||||
list:
|
||||
- one
|
||||
- two
|
||||
- three
|
||||
14
test/test_configFailed.yaml
Normal file
14
test/test_configFailed.yaml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# ____ ____ ______ __ __ __ _____
|
||||
# / __ )/ __ \/ ___/ | / /___ _/ /______/ /_ |__ /
|
||||
# / __ / / / /\__ \| | /| / / __ `/ __/ ___/ __ \ /_ <
|
||||
# / /_/ / /_/ /___/ /| |/ |/ / /_/ / /_/ /__/ / / / ___/ /
|
||||
#/_____/\____//____/ |__/|__/\__,_/\__/\___/_/ /_/ /____/
|
||||
# German BOS Information Script
|
||||
#
|
||||
|
||||
# for the test_config - a config failing while loading
|
||||
types:
|
||||
failedIntend: Hello World # this line has false indentation
|
||||
rightIntend: Hello World
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue