Commit graph

9 commits

Author SHA1 Message Date
samuelgregorovic
ae009099ed
Add --config-file argument to use alternate config file at runtime (#1290)
* added new CLI argument option --config-file

* pass argument and fetch alt config file if specified

* argparse argument setting update

* argument alias --cf added

* documentation update - usage of CLI argument

* fixed name-clash + unit tests

* feature test added

* #1170-alternate-config-file: Auto stash before rebase of "refs/heads/#1170-alternate-config-file"

* Update docs/advanced.md

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>

* BDD tests added

* Begin migrating/rewording --cf tests in pytest-bdd.

Uses current directory instead of deep directory structure, but requires a given for each config file referenced

* Fix issue where specifying a config-file that needs to be upgraded ended up upgrading the user config file instead

* Uncomment and rework remaining tests for pytest-bdd instead of behave

* Fix copytree for Python 3.7 (which doesn't support dirs_exist_ok)

* Minor fixes to alternative config examples

* Remove behave tests (behave is no longer in use)

* Move config file unit test to unit test dir and use pytext path fixture instead of current directory to find test data

* Use explicit "given the config exists" for copying config files instead of shoehorning in "given we use the config" twice

* Change when/when to when/and

* Clarify scenarios and fix indentation

* Confirm primary config file isn't modified when encrypting/decrypting a journal in an alternate config file

* Remove try/except on copytree since I'm no longer using the same

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-11-06 14:12:34 -07:00
Jonathan Wren
44edb9bdee
Add more steps to pytest, fully remove behave (#1347)
* update yaml loader to new method

* Add config overrides steps to pytest

This requires some patching around the config object, which now happens
in every test.

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>

* udpate docs for new tests

* remove behave from deps

* remove feature dir from flake8 checks

* udpate lock file

* disable pip version check (it keeps spamming the pipeline)

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-10-09 12:10:08 -07:00
Jonathan Wren
7d8823da6d
Move remaining tests from behave to pytest (#1346)
* add newer tests to pytest (from behave)

* remove 'lib' from gitignore (since we're using it)

* fix capitalization in some steps

* add 'the editor should not have been called' step

* comment out config override step in pytest-bdd since it's not implemented yet

* remove test that didn't really test anything

* implement some missing steps in pytest-bdd

* change comment to match other tests
2021-10-02 13:31:21 -07:00
Micah Jerome Ellison
5abf974682
Fix deletion of entries on folder journal through --delete flag (#1328)
* Re-enable failing folder/DayOne tests
* Disable dayone tests again - out of scope for this problem
* Fix folder journal deletion by tracking which dates are associated with deleted entries
2021-08-28 13:18:34 -07:00
Micah Jerome Ellison
fa146b1434
Warn when DayOne/directory journals have encrypt: true in config (#1325)
* Raise exception when trying to commit folder-based journal (including DayOne)
* Change negative bool name to a positive
* Add test to ensure this doesn't mess with encrypting normal journals
* Consolidate and standardized tests
* Add failing test for new error message about unencryptable journals
* Warn when encrypt is true and journal type is directory/DayOne
2021-08-21 14:47:49 -07:00
Micah Jerome Ellison
050c17ee06
Allow emoji in config file in Windows by always opening it as unicode (#1313)
* Open config file as utf-8 always
* Add test for journal with emoji name
2021-08-21 14:43:11 -07:00
Micah Jerome Ellison
7109374d42
Fix failure to import into directory journal (#1314)
* Re-enable failing directory journal import tests
* Appropriately track journal name and modified entries in FolderJournal when importing
* Run make format
2021-08-21 14:42:31 -07:00
Micah Jerome Ellison
3e5a55b1e9
Display error when trying to encrypt folder/DayOne journal types (#1315)
* Raise exception when trying to commit folder-based journal (including DayOne)
* Add test to ensure this doesn't mess with encrypting normal journals
* Consolidate and standardized tests
2021-08-21 13:46:29 -07:00
Jonathan Wren
f99411f2f9 move some files around because pytest is being weird 2021-07-03 15:49:18 -07:00