Add support to save journals to multiple files in a directory

Update FolderJournal reference to entry __unicode__ method to __str__
Remove DayOne test made obsolete by FolderJournal
Fix FolderJournal path tests for Windows paths
Apply Black linting
This commit is contained in:
Micah Jerome Ellison 2020-02-29 12:35:05 -08:00
parent a3c81d46fe
commit 6985de2844
5 changed files with 37 additions and 32 deletions

View file

@ -210,10 +210,11 @@ def check_output_time_inline(context, text):
@then("the output should contain")
@then('the output should contain "{text}"')
def check_output_inline(context, text=None):
@then('the output should contain "{text}" or "{text2}"')
def check_output_inline(context, text=None, text2=None):
text = text or context.text
out = context.stdout_capture.getvalue()
assert text in out, text
assert text in out or text2 in out, text or text2
@then('the output should not contain "{text}"')
@ -269,15 +270,17 @@ def check_journal_entries(context, number, journal_name="default"):
journal = open_journal(journal_name)
assert len(journal.entries) == number
@when('the journal directory is listed')
@when("the journal directory is listed")
def list_journal_directory(context, journal="default"):
files=[]
files = []
with open(install.CONFIG_FILE_PATH) as config_file:
config = yaml.load(config_file, Loader=yaml.FullLoader)
journal_path = config['journals'][journal]
journal_path = config["journals"][journal]
for root, dirnames, f in os.walk(journal_path):
for file in f:
print(os.path.join(root,file))
for file in f:
print(os.path.join(root, file))
@then("fail")
def debug_fail(context):