Commit graph

9 commits

Author SHA1 Message Date
Micah Jerome Ellison
c38c39efee
Update dependencies - pyxdg, pytest, black (#1076)
* 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
2020-11-14 12:42:34 -08:00
Jonathan Wren
d916f66dbf
[WIP] Lots of test refactoring (#1042)
* make behave slightly less verbose for use with behave --format progress2
* standardize behave tests
* move tests around to be more behavior driven
* clean up txt file after tests
* add more tests, add more functionality to behave for calling mock editor
* move around behave tests, get rid of regression files
* clean up some code around keyrings
* add more placeholder test scenarios (marked with @todo)
  You can run just these tests with `behave --no-skipped --tags=todo`
* fix "missing_directory" test
  This test was missing the config file it was trying to use. So, it was
  really a very useless, broken test that we absolutely should not have
  approved the PR (#963) for.
* add write tests for each journal type
* update version tests, add new regex match behave step
* add config test outlines
* add journal types to some search tests
* change "basic" config reference to "simple"
* update configs
* add more journal types in search
* fix basic folder journal reference
* add flush output steps to behave, update delete flag tests
* fix failing test with a flush
* update more delete flag tests to include other journal types
* fix file cleanup after failed test with no debug on
* fix password test
* fix DayOne tag sample data, move search/format tag tests, and run them on multiple jrnl types
* added ability to auto-prompt for password for encrypted journals
  Only uses password when prompted, and doesn't get in the way of other
  input prompts. This allows us to run the same scenarios on both
  encrypted journals and other journal types.
* fold encrypted scenarios into the rest of the scenarios where possible
* remove apostrophe that is breaking tests on CI
* add more journal type tests to import feature
* standardize whitespace in behave tests, take out duplicate test
* update handling of cache directories in test suite (easier syntax)
* skip failing YAML exporter emoji test on Windows
* added @todo tags for things that need follow-up

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2020-10-17 15:17:38 -07:00
Jonathan Wren
631e08a557
Clean up help screen, get rid of util.py (#1027)
* 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>
2020-08-22 11:40:39 -07:00
eshrh
be38cfa87a Add tags to json and xml exporters (#975)
* tag array for json
* add tags to entry in xml
* xml test
* json test
* black
* removed called
2020-06-13 11:58:35 -07:00
MinchinWeb
404760876f Add extended metadata support for DayOne Classic (#928)
* Updating changelog [ci skip]

* Incrementing version to v2.4 [ci skip]

* [DayOne] remove extra spaces from the titles of edited DayOne entries

Otherwise, a leading space was being introduced

* [DayOne] maintain existing tags stored in DayOne metadata

* [DayOne] brings back extended DayOne attributes

* [DayOne] maintain metadata on edited entries

Fixes #358, See also #159

* [DayOne Exporter] apply black formatting

* [JSON Exporter] add support for extended DayOne Metadata

* [DayOne] [Tests] test that extended DayOne metadata is added to new entries

Co-authored-by: Jrnl Bot <jrnl.bot@gmail.com>
2020-06-06 12:41:15 -07:00
MinchinWeb
cfadcd39ca Apply isort Mk II (#942)
* Apply isort!
2020-05-09 13:14:43 -07:00
Jonathan Wren
ecb4562c29 Make sure testing cleans up after itself (#940)
This adds the ability to run commands in a cache directory without the
test writer knowing where the cache directory is located. This will let
us expand later if we want to start using system temp folders, without
having to rewrite any of our tests.

* clean up extra directories after running behave
* clean up white space issues
* move repeated code into function
* clean up behave code for creating cache directories
* Fix for windows shell parsing in our test suite

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2020-05-06 18:13:36 -07:00
MinchinWeb
68ad5c0c1a Ensure exported entries end in a newline for Markdown and YAML exporters (#908)
* [Markdown Exporter] [YAML Exporter] Ensure exported entires end in a newline

Fixes #768, Fixes #881.

If the exported entry does not have a final empty line, this will add one on export. Some Markdown parsers get picky about not having a empty line above a heading....

* fix black formatting issues
* explicitly sort filenames

to deal with inconsistent default file ordering on different OS's
* Update .gitignore
* Update test for typo fix

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2020-04-18 12:35:46 -07:00
Stav Shamir
8b7ebe2dcd Add test scenarios for the export feature (#824)
* Fix behave keyword "and" to correct case "And"
* Extract export_steps module
* Add scenario for XML export
* Add scenario for tags export
* Add scenario for fancy export
* Add scenario for yaml export
* Remove unused module export.py
* Run `make format`
* Fix `create_directory` step
2020-04-10 11:51:56 -07:00