Extract helper methods for building config objects from dicts
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
parent
3f3c05e465
commit
2c75a8fdf5
4 changed files with 36 additions and 32 deletions
16
tests/helpers.py
Normal file
16
tests/helpers.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
from __future__ import absolute_import
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from compose.config.config import ConfigDetails
|
||||
from compose.config.config import ConfigFile
|
||||
from compose.config.config import load
|
||||
|
||||
|
||||
def build_config(contents, **kwargs):
|
||||
return load(build_config_details(contents, **kwargs))
|
||||
|
||||
|
||||
def build_config_details(contents, working_dir='working_dir', filename='filename.yml'):
|
||||
return ConfigDetails(
|
||||
working_dir,
|
||||
[ConfigFile(filename, contents)])
|
||||
Loading…
Add table
Add a link
Reference in a new issue