mirror of
https://github.com/BOSWatch/BW3-Core.git
synced 2026-04-04 13:57:44 +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
|
||||
Loading…
Add table
Add a link
Reference in a new issue