Update
This commit is contained in:
5
pytest.ini
Normal file
5
pytest.ini
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
[pytest]
|
||||||
|
pythonpath =
|
||||||
|
src
|
||||||
|
testpaths =
|
||||||
|
tests
|
||||||
10
src/configurator/common.py
Normal file
10
src/configurator/common.py
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
__author__ = 'RemiZOffAlex'
|
||||||
|
__email__ = 'remizoffalex@mail.ru'
|
||||||
|
|
||||||
|
import yaml
|
||||||
|
|
||||||
|
|
||||||
|
def yaml_read(filename):
|
||||||
|
with open(filename, 'r') as fd:
|
||||||
|
data = yaml.load(fd, Loader=yaml.Loader)
|
||||||
|
return data
|
||||||
22
tests/test_config.py
Normal file
22
tests/test_config.py
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import pytest
|
||||||
|
|
||||||
|
from configurator.config import Config
|
||||||
|
|
||||||
|
|
||||||
|
def config_dict():
|
||||||
|
return {
|
||||||
|
'kscfg': None,
|
||||||
|
'parent': {
|
||||||
|
'child': 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def test_config():
|
||||||
|
config = Config(config_dict())
|
||||||
|
assert config.kscfg is None
|
||||||
|
|
||||||
|
|
||||||
|
def test_config_sub():
|
||||||
|
config = Config(config_dict())
|
||||||
|
assert config.parent.child == 1
|
||||||
Reference in New Issue
Block a user