1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-08 08:29:17 +00:00

refactor and add more tests

This commit is contained in:
deadc0de6
2017-03-15 20:56:16 +01:00
parent 12df68bf70
commit 74be6a4e25
2 changed files with 31 additions and 15 deletions

View File

@@ -10,6 +10,8 @@ import string
import random
import tempfile
from dotdrop.config import Cfg
TMPSUFFIX = '.dotdrop'
@@ -51,6 +53,17 @@ def create_dir(path):
return path
def load_config(confpath, dotpath, profile):
'''Load the config file from path'''
conf = Cfg(confpath, dotpath)
opts = conf.get_configs()
opts['dry'] = False
opts['profile'] = profile
opts['safe'] = True
opts['installdiff'] = True
return conf, opts
def create_fake_config(folder, configname='config.yaml',
dotpath='dotfiles', backup=True, create=True):
'''Create a fake config file'''