From dbf5caa971a1ad8797ae9ccbf7018a7b29ef7888 Mon Sep 17 00:00:00 2001 From: Manuel Ebert Date: Mon, 22 Jul 2013 21:19:30 +0200 Subject: [PATCH] Changes cleaning strategy --- features/{ => data}/configs/basic.json | 0 features/{ => data}/configs/encrypted.json | 0 features/{ => data}/configs/multiple.json | 0 features/data/journals/encrypted.journal | Bin 0 -> 128 bytes features/{ => data}/journals/simple.journal | 0 features/{ => data}/journals/work.journal | 0 features/environment.py | 21 ++++++++------------ features/journals/encrypted.journal | 3 --- 8 files changed, 8 insertions(+), 16 deletions(-) rename features/{ => data}/configs/basic.json (100%) rename features/{ => data}/configs/encrypted.json (100%) rename features/{ => data}/configs/multiple.json (100%) create mode 100644 features/data/journals/encrypted.journal rename features/{ => data}/journals/simple.journal (100%) rename features/{ => data}/journals/work.journal (100%) delete mode 100644 features/journals/encrypted.journal 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 0000000000000000000000000000000000000000..339b47baf9671f4550efeb9b6a0cfcd5032255d6 GIT binary patch literal 128 zcmV-`0Du3(bJIGVsY(mXmoW-2hF&*L`0NbJTYlTUr8*^Qm97}8E^3^1bZ$P^M literal 0 HcmV?d00001 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