mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 16:48:31 +02:00
Changes cleaning strategy
This commit is contained in:
parent
c0733f36c5
commit
dbf5caa971
8 changed files with 8 additions and 16 deletions
BIN
features/data/journals/encrypted.journal
Normal file
BIN
features/data/journals/encrypted.journal
Normal file
Binary file not shown.
|
@ -13,22 +13,17 @@ def before_scenario(context, scenario):
|
||||||
jrnl.util.STDERR = context.messages
|
jrnl.util.STDERR = context.messages
|
||||||
jrnl.util.TEST = True
|
jrnl.util.TEST = True
|
||||||
for folder in ("configs", "journals"):
|
for folder in ("configs", "journals"):
|
||||||
original = os.path.join("features", folder)
|
original = os.path.join("features", "data", folder)
|
||||||
backup = os.path.join("features", folder+"_backup")
|
working_dir = os.path.join("features", folder)
|
||||||
if not os.path.exists(backup):
|
if not os.path.exists(working_dir):
|
||||||
os.mkdir(backup)
|
os.mkdir(working_dir)
|
||||||
for filename in os.listdir(original):
|
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):
|
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.close()
|
||||||
context.messages = None
|
context.messages = None
|
||||||
for folder in ("configs", "journals"):
|
for folder in ("configs", "journals"):
|
||||||
original = os.path.join("features", folder)
|
working_dir = os.path.join("features", folder)
|
||||||
backup = os.path.join("features", folder+"_backup")
|
shutil.rmtree(working_dir)
|
||||||
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)
|
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
~<7E>|Ó5‘Ç\<«‰É
|
|
||||||
hq˛ŞFŰC’Z[\óÖĎE¨LůxĽyą
|
|
||||||
e©ęowW(ŽăłŻO4š;¨<>µpŔĎÜ÷[<5B>fţD$K¤7ů4ő•ˇ<E280A2>C›óˇ{&;duŃ˙jŢĂ ę|Z@“?WŔů·ĆGłţÝ•W ÷ÇÓŰâ,z2Í
|
|
Loading…
Add table
Reference in a new issue