add some tests, black formatting

This commit is contained in:
dbxnr 2020-02-11 20:13:32 +00:00
parent 608f920d8f
commit 0c73448516
7 changed files with 68 additions and 34 deletions

View file

@ -0,0 +1,17 @@
{
"articles": [
{
"audio_files": [],
"creation_date": "2020-01-10T12:22:12Z",
"photo": [],
"favourites": false,
"tag": [],
"body": "Entry Number One.",
"time_zone": "Europe/London",
"id": "EBB5A5F4057F461E8F176E18AB7E0493"
}
],
"metadata": {
"version": "1.2"
}
}

View file

@ -2,14 +2,26 @@ Feature: Day One 2.0 implementation details.
Scenario: Loading a Day One 2.0 journal
Given we use the config "dayone2.yaml"
When we run "jrnl -n 2"
Given we use the config "basic.yaml"
When we run "jrnl --import dayone2 features/data/journals/dayone2.json"
Then we should get no error
and the output should be
"""
2020-01-10 12:21 Entry Number Two.
| And a bit of text over here.
and the output should contain "Journal exported to"
2020-01-10 12:22 Entry Number One.
"""
Scenario: Day One 2.0 schema validation fails
Given we use the config "basic.yaml"
When we run "jrnl --import dayone2 features/data/journals/not_dayone2.json"
Then we should get no error
and the output should contain "not the expected Day One 2 format."
Scenario: Verify conversion to jrnl
Given we use the config "basic.yaml"
When we run "jrnl --import dayone2 features/data/journals/dayone2.json"
When we run "jrnl -ls"
Then the output should be
"""
2013-06-09 15:39 My first entry.
| Everything is alright
2013-06-10 15:40 Life is good.
| But I'm better.
"""