This commit is contained in:
= 2020-05-29 17:15:15 -04:00
parent c03f0ab2d7
commit bebe1b9d9d
2 changed files with 9 additions and 4 deletions

View file

@ -3,6 +3,8 @@ import shutil
import sys
CWD = os.getcwd()
def clean_all_working_dirs():
for folder in ("configs", "journals", "cache"):
working_dir = os.path.join("features", folder)
@ -52,6 +54,6 @@ def before_scenario(context, scenario):
def after_scenario(context, scenario):
"""After each scenario, restore all test data and remove working_dirs."""
if os.getcwd()!=CWD:
if os.getcwd() != CWD:
os.chdir(CWD)
clean_all_working_dirs()

View file

@ -79,16 +79,19 @@ def set_config(context, config_file):
with open(install.CONFIG_FILE_PATH, "a") as cf:
cf.write("version: {}".format(__version__))
@given('there is no config')
@given("there is no config")
def no_config(context):
nopath = "features/configs/missingconfig.yaml"
install.CONFIG_FILE_PATH = os.path.abspath(nopath)
#install.CONFIG_FILE_PATH_FALLBACK = os.path.abspath(nopath)
# install.CONFIG_FILE_PATH_FALLBACK = os.path.abspath(nopath)
@when('we change directory to "{path}"')
def move_up_dir(context,path):
def move_up_dir(context, path):
os.chdir(path)
@when('we open the editor and enter "{text}"')
@when("we open the editor and enter nothing")
def open_editor_and_enter(context, text=""):