Simplify config override syntax (#5)

* update tests and expected behavior

* clean up arg parsing tests

* update deserialization

* update deserialization

* config argparse action

* update override application logic

* update tests; delete unused imports

* override param must be list

* update docstring

* update test input to SUT

* update remaining override unittests

* make format

* forgot to update CLI syntax
This commit is contained in:
Suhas 2021-01-31 20:17:02 -05:00 committed by GitHub
parent 40f93a9322
commit 6e658c31df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 82 additions and 114 deletions

View file

@ -2,13 +2,13 @@ Feature: Implementing Runtime Overrides for Select Configuration Keys
Scenario: Override configured editor with built-in input === editor:''
Given we use the config "tiny.yaml"
When we run jrnl with --config-override editor:''
When we run jrnl with --config-override editor ''
Then the stdin prompt must be launched
@skip_win
Scenario: Override configured linewrap with a value of 23
Given we use the config "tiny.yaml"
When we run "jrnl -2 --config-override linewrap:23 --format fancy"
When we run "jrnl -2 --config-override linewrap 23 --format fancy"
Then the output should be
"""
@ -30,13 +30,13 @@ Feature: Implementing Runtime Overrides for Select Configuration Keys
@skip_win
Scenario: Override color selections with runtime overrides
Given we use the config "tiny.yaml"
When we run jrnl with -1 --config-override colors.body:blue
When we run jrnl with -1 --config-override colors.body blue
Then the runtime config should have colors.body set to blue
@skip_win
Scenario: Apply multiple config overrides
Given we use the config "tiny.yaml"
When we run jrnl with -1 --config-override colors.body:green,editor:"nano"
When we run jrnl with -1 --config-override colors.body green --config-override editor "nano"
Then the runtime config should have colors.body set to green
And the runtime config should have editor set to nano
@ -44,7 +44,7 @@ Feature: Implementing Runtime Overrides for Select Configuration Keys
@skip_win
Scenario Outline: Override configured editor
Given we use the config "tiny.yaml"
When we run jrnl with --config-override editor:"<editor>"
When we run jrnl with --config-override editor "<editor>"
Then the editor <editor> should have been called
Examples: Editor Commands
| editor |