move overrides earlier in the execution

use existing configs instead of custom

make format

clean up imports
This commit is contained in:
sriniv27 2021-02-08 20:15:10 -05:00
parent c8e09b023f
commit 1df4b74e53
5 changed files with 23 additions and 27 deletions

View file

@ -400,13 +400,14 @@ def run(context, command, text=""):
if "cache_dir" in context and context.cache_dir is not None:
cache_dir = os.path.join("features", "cache", context.cache_dir)
command = command.format(cache_dir=cache_dir)
if "config_path" in context and context.config_path is not None:
if "config_path" in context and context.config_path is not None:
with open(context.config_path, "r") as f:
cfg = yaml.load(f, Loader=FullLoader)
context.jrnl_config = cfg
args = split_args(command)
context.args = args[1:]
def _mock_editor(command):
context.editor_command = command
tmpfile = command[-1]

View file

@ -1,17 +1,14 @@
from jrnl.jrnl import run
from jrnl.os_compat import split_args
from unittest import mock
# from __future__ import with_statement
from jrnl.args import parse_args
import os
from behave import given, when, then
import yaml
from yaml.loader import FullLoader
from behave import given, then
import jrnl
from features.steps.core import _mock_time_parse
from features.steps.core import _mock_getpass, _mock_time_parse
@given("we use the config {config_file}")