Skip to content

Commit

Permalink
Plugins: First pass at testing custom importer
Browse files Browse the repository at this point in the history
  • Loading branch information
MinchinWeb committed Jun 27, 2021
1 parent ef28574 commit 4b72910
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
15 changes: 15 additions & 0 deletions features/data/simple_import.json
@@ -0,0 +1,15 @@
{
"entries" :
[
{
"date" : "2013-06-09 15:39",
"title" : "My first entry.",
"body" : "Everything is alright"
},
{
"date" : "2013-06-10 15:40",
"title" : "Life is good.",
"body" : "But I'm better."
}
]
}
24 changes: 16 additions & 8 deletions features/plugins.feature
Expand Up @@ -5,7 +5,7 @@ Feature: Functionality of Importer and Exporter Plugins
Given We use the config "basic_onefile.yaml"
When We run "jrnl --version"
Then the output should contain pyproject.toml version
And The output should contain "<plugin_name> : <version> from jrnl.<source>.<type>.<filename>"
And the output should contain "<plugin_name> : <version> from jrnl.<source>.<type>.<filename>"
And the output should not contain ".contrib."

Examples:
Expand All @@ -31,7 +31,8 @@ Feature: Functionality of Importer and Exporter Plugins
Given We use the config "basic_onefile.yaml"
When We run "jrnl --version"
Then the output should contain pyproject.toml version
And The output should contain "<plugin_name> : <version> from jrnl.<source>.<type>.<filename>"
And the output should contain "<plugin_name> : <version> from jrnl.<source>.<type>.<filename>"

Examples:
| plugin_name | version | source | type | filename |
| jrnl | <pyproject.toml version> | plugins | importer | jrnl |
Expand Down Expand Up @@ -65,9 +66,15 @@ Feature: Functionality of Importer and Exporter Plugins
| json | <pyproject.toml version> | plugins | exporter | json |
| txt | <pyproject.toml version> | plugins | exporter | text |

@skip_only_with_external_plugins
Scenario Outline: Custom JSON Import
Given we use the config "empty_folder.yaml"
When we run "jrnl --import ./features/data/simple_import.json"
Then the journal should contain "My first entry."
And the journal should contain "Life is good."

@skip_only_with_external_plugins
Scenario Outline: JSON format
Scenario Outline: Custom JSON Export
Given we use the config "<config>.yaml"
And we use the password "test" if prompted
When we run "jrnl --format json"
Expand All @@ -79,8 +86,9 @@ Feature: Functionality of Importer and Exporter Plugins
And entry 3 should not have an array "tags"

Examples: configs
| config |
| basic_onefile |
| basic_encrypted |
| basic_folder |
| basic_dayone |
| config |
| basic_onefile |
| basic_encrypted |
| basic_folder |
| basic_dayone |

0 comments on commit 4b72910

Please sign in to comment.