diff --git a/features/configs/basic.json b/features/data/configs/basic.json similarity index 100% rename from features/configs/basic.json rename to features/data/configs/basic.json diff --git a/features/configs/encrypted.json b/features/data/configs/encrypted.json similarity index 100% rename from features/configs/encrypted.json rename to features/data/configs/encrypted.json diff --git a/features/configs/multiple.json b/features/data/configs/multiple.json similarity index 100% rename from features/configs/multiple.json rename to features/data/configs/multiple.json diff --git a/features/data/journals/encrypted.journal b/features/data/journals/encrypted.journal new file mode 100644 index 00000000..339b47ba Binary files /dev/null and b/features/data/journals/encrypted.journal differ diff --git a/features/journals/simple.journal b/features/data/journals/simple.journal similarity index 100% rename from features/journals/simple.journal rename to features/data/journals/simple.journal diff --git a/features/journals/work.journal b/features/data/journals/work.journal similarity index 100% rename from features/journals/work.journal rename to features/data/journals/work.journal diff --git a/features/environment.py b/features/environment.py index a25d2fff..89125fca 100644 --- a/features/environment.py +++ b/features/environment.py @@ -13,22 +13,17 @@ def before_scenario(context, scenario): jrnl.util.STDERR = context.messages jrnl.util.TEST = True for folder in ("configs", "journals"): - original = os.path.join("features", folder) - backup = os.path.join("features", folder+"_backup") - if not os.path.exists(backup): - os.mkdir(backup) + original = os.path.join("features", "data", folder) + working_dir = os.path.join("features", folder) + if not os.path.exists(working_dir): + os.mkdir(working_dir) for filename in os.listdir(original): - shutil.copy2(os.path.join(original, filename), backup) + shutil.copy2(os.path.join(original, filename), working_dir) def after_scenario(context, scenario): - """After each scenario, restore all test data and remove backups.""" + """After each scenario, restore all test data and remove working_dirs.""" context.messages.close() context.messages = None for folder in ("configs", "journals"): - original = os.path.join("features", folder) - backup = os.path.join("features", folder+"_backup") - for filename in os.listdir(original): - os.remove(os.path.join(original, filename)) - for filename in os.listdir(backup): - shutil.copy2(os.path.join(backup, filename), original) - shutil.rmtree(backup) + working_dir = os.path.join("features", folder) + shutil.rmtree(working_dir) diff --git a/features/journals/encrypted.journal b/features/journals/encrypted.journal deleted file mode 100644 index 1c40a799..00000000 --- a/features/journals/encrypted.journal +++ /dev/null @@ -1,3 +0,0 @@ -~ƒ|Ó5‘Ç\<«‰É -hq²ªFÛC’Z[\óÖÏE¨Lùx¼y¹ -e©êowW(Žã³ ¯O4š;¨µpÀÏÜ÷[ˆfþD$K¤7ù 4õ•¡C›ó¡{&;duÑÿjÞàê|Z@“?WÀù·ÆG³þÝ•W ÷ÇÓÛâ,z2Í \ No newline at end of file