- Implement TestKeyring
- Implement NoKeyring
- Implement FailedKeyring
- Copy in `read_value_from_string` function from old tests (will
probably rewrite this later)
- Add fixtures for keyrings
- Implement "we have a keyring" step
- Implement step to check specific config values for tests
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
- Makefile no longer runs on virtual env modules
- Update some function names so pyflakes doesn't error
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
- Add some necessary fixtures
- Add datetime test
- Implement "the output should not contain" step
- Implement "the output should contain the date" step
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
- Allow config step to support scenario outlines
- Add another datetime test
- Get rid of read journal step since it doesn't work with other journal
types (we should rely on jrnl knowing how to parse each jrnl type for
better tests)
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
This will prevent any unexpected files from showing up anywhere outside
the temp dir
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
- Deletes most of the datetime tests so that they can be
re-added as they are implemented in pytest-bdd
- Implements steps that check the journal and output for strings
- Get rid of deployment tag (we're not using it, anyway)
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
Pytest-bdd uses fixtures to handle most things. This makes a fixture
that will create a temp directory for the tests to run in.
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
- Copy over the current tests from behave into the new directory that
pytest-bdd will use them in
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
* behavior outline
* enforce positive initial linewrap
Check column widths
update gitignore
throw error when linewrap too small
simply check for large enough linewrap value
* delete unused error message
* PR feedback
make exception more informative
update check_linewrap signature in src and test
make check_linewrap a free function
* delete unused function
* delete else..pass block
* newline for make format
Add --config-override feature
* add test and argument handler for runtime override of configurations.
* identify location to apply override in "main"
* update gitignore
* remove unneeded import
* add jrnl interface test for overriden configurations
* trivial whitespace change
* implement runtime override
* make format
* refactor override unittest
* clean up unused import
* start writing integration test
* add linewrap override scenario
* implement editor override step
* add dev dependencies on pytest -mock and -cov
* make format
* remove unused imports
* make format
* rename --override to --config-override
* move override implementation into own module
* begin TDD of dot notated overrides
* rewrite behavior scenario
* implement recursive config overrides
* clean up unittests
* iterate on behave step
* make format
* cleanup
* move override behave tests out of core
* refactor recursive code
* make format
* code cleanup
* remove unused import
* update test config
* rewrite test for better mock call expect
* make format
* binary search misbehaving windows test
* unittest multiple overrides
* uncomment dot notation unittest
* add multiple override scenario spec
* make format
* make format
* update unittests for new syntax
* update integ tests for new syntax
* update gitignore
* guard override application
* deserialize function as return type
* make format
* organize deserialization unittests
* better, more specific behave tests
* test different editor launch commands
* formatting
* handle datatypes in deserialization and update helptext
* stick to config convention in testbed
* update tests ith better verifications
* make format
* space
* review feedbac
* make format
* skip on win
* update deps
* update tests with better verifications
make format
space
review feedbac
* skip on win
* update deps
* refactor deserialization
organize test_parse_args
make format
* skip on win
* refactor deserialization
organize test_parse_args
make format
* update tests ith better verifications
* make format
* space
* make format
* document apply_overrides
* update gitignore
* document config-override enhancement
* 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
* update documentation to sphinx style
* variable renames
* Lockfile merge (#7)
* Add brew and gitter badges to README
* Update changelog [ci skip]
* Make journal selection behavior more consistent when there's a colon with no date (#1164)
* Simplify config override syntax (#8)
* 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
* formatting
* Update pyproject.toml
* update lockfile to remove pytest-cov and pytest-mock deps
* update docs
* reuse existing mock; delete unneeded code
* move overrides earlier in the execution
use existing configs instead of custom
make format
clean up imports
* update for passworded access
context.parser -> parsed_args
* test that no editor is launched
* remove unnecessary mocks
* rename variable for intent
* reinstate getpass deletion
* update gitignore
* capture failure mode
* remove unneeded imports
* renamed variable
* delete redundant step
* comment on step
* clean up step behavior description
* [WIP] lock down journal access behavior
* skip -> wip
* correct command for overriding journal via dot keys
* update wip test for updating a "temp" journal and then reading baack its entries
* remove "mock" from poetry file
* make CI happy
* complex behavior sequence for default journal override
* separate out smaller pieces of logic
test that apply_overrides acts on base configuration and not the copy
* defer modification of loaded configuration to update_config
remove unused fixtures
delete complicated UT since behavior is covered in overrides.feature integ test
delete redundant UT
* Update .gitignore
* remove skip_win
* forward override unpacking to yaml library
* merge config override step with existing config_var step in core
delete config_override step
unify step description syntax
* delete unused and redundant code
* rebases are hard
* remove wip tag from test
* remove skipped tests for windows
* Address code review
yield -> return
remove needless copy
adjust spacing
re-inline args return
reset packaging info to e6c0a16342
revert package version for this PR
* consolidate imports
* Defer config_override unpacking to dict *after* base config is loaded
store cli overrides without unpacking just yet
move deserialize_config_args to config module
delete custom Action class for config operations
apply [k,v] -> {k, v} for each override
update test data
update import
* rename deserialize_config_args to better express intent
make format
* Fix inverted POSIX check, refactor os_compat, and add tests for it
* Fix missing parentheses and remove skip_win on test that is passing in Windows now
* Fix expected quotes in quoted args
* Make output clearer on failing test
* Bringing skip_win back to test whose failure is a bit more complicated than expected
* Introduce -reminisce, -month, -day, and -year
* Update expected_args in parse_args tests
* Add check before creating compare_d
* Misc changes
* Implement testing for -month, -day, -year, and -reminisce
* Compress tests into one Scenario Outline
* Fix failing tests by updating dates_similar journal
* Create 'we set current date and time to' step
* Use time.parse in reminisce
* Update dates_similar journal
* Make 'Searching in a journal' test shorter
* Lint
* Implement reminiscing test
* Add combination tests
* Finalize tests
* Finalize pytests
* Simplify reminisce tests
* Change reminsice help (since it also shows today's entries)
* Re-do tests; use various tests
* Remove old test data
* Better scenario description
* Standardize format for compare_d
* Rename -reminisce to -today-in-history
* Moving configuration values and methods from install.py to config.py -- everything is broken right now
* Using context to store config path - still lots broken
* Use mocks and context.config_path to store test configs - many tests still broken though
* Update changelog [ci skip]
* Fix jrnl --ls crash
* Fix crash when no editor configured
* Attempt to patch config path with test data - doesn't appear to be working
* Properly use patched config path and add config given to scenario that wasn't using it
* Fix copypasta
* Fix editor test that needed patched config and trapping for system exit
* Add exception and handling for when configuration directory is actually a file
* Remove extraneous comment
* Use more generic JrnlError with messaging switchboard
* Format code a bit nicer
* Remove unnecessary given in diagnostic test
* Ensure full error message is output
* Remove unnecessary whitespace characters
* Update version pin on pyxdg and run poetry update
* Update pytest pin and rerun poetry update
* Update black pin to latest version, poetry update, and make format
* More refactoring of cli.py
break up code from cli.py (now in jrnl.py) up into smaller functions
get rid of export mode
move --encrypt and --decrypt to commands.py
clean up the help screen even more
update flag name for import
* reorganize code, move around lots of functions
* clean up import statements
* move run function out of cli and into jrnl
* rename confusingly named function
* move editor function into editor file
* rename parse_args.py to args.py to make room for more args functions
* Fix error in test suite for windows
I accidentally flipped the conditional, so this fixes it.
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
* Update app description on help screen
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
Also, cleaned up the way the arg parser handles standalone commands.
Rather than checking individually for each command, you can now register
the command in the proper place, and it will be run with all known
arguments (and cofig if available).