Commit graph

61 commits

Author SHA1 Message Date
Micah Jerome Ellison
4ca6e3f95f Display warning if Python version is less than 3.7 (#994)
* Add Python version check and faulty test to confirm it's working (should fail on 3.6 build only)
* Apply formatting
* Fix behave Python version test
* Make error message more descriptive and friendly
2020-07-12 16:24:46 -07:00
eshrh
2a3fd820b9 Create journal with absolute path when no path is specified (#972)
* create jrnl with abspath

Co-authored-by: = <esrh@netc.eu>
2020-06-13 11:08:22 -07:00
Eshan
0b9137c17d Fix set_keychain errors (#964)
* fix keyring problems
* black
* remove else and use stderr
* black
* add tests
* black
* change description of nokeyring
* dumb syntax error
2020-05-30 12:43:10 -07:00
Jonathan Wren
7c7e2fae82 Fix for hanging Windows tests on Travis (#969) 2020-05-27 18:22:09 -07:00
Jonathan Wren
a4d020423f Fix editor config when an argument with a space is used (#953)
* Fix editor config when an argument with a space is used
* skip broken test on windows
* fix jrnl not behaving nicely with testing suite
* fix argument parsing for test suite
* fix one windows test, disable one windows test
2020-05-23 15:56:31 -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
Micah Jerome Ellison
d9ebfe852b Prevent filtered delete from deleting journal (#935)
* Prevent filtered deletion from deleting entire journal #932 and add lots of deletion tests
* Undo removal of deletion feature
* Use more performant deletion
2020-05-06 13:47:39 -07:00
Jonathan Wren
e3a46e9846 fix various small issues in the codebase 2020-04-18 12:35:46 -07:00
MinchinWeb
42bebd5632 Test Version match (#887)
* [Tests] makes sure `--version` works
Directly reads the version number from pyproject.toml

* Tag the tests
To run just this test, use `behave --tags=deployments_tests`
2020-04-18 12:35:46 -07:00
Jonathan Wren
0e1f415c97 Fix failing tests and linting issues 2020-04-10 16:18:34 -07:00
Jonathan Wren
302d353c4d Fix up tests and related issues
Upgrade poetry if already installed
Get rid of test function that was causing windows problems
2020-04-10 11:51:56 -07:00
Aaron Lichtman
9e5d160bbd Pretty print journal entries (#692)
* Pretty print journal entry titles and dates.

Changes appearance of all jrnl viewing commands, such as $ jrnl --short and
$ jrnl -n {NUM}.

Fix #508

* Removed extra newline at end of title

* Use ansiwrap to properly wrap strings with ANSI escapes

* Add ansiwrap to pyproject.toml

* Allow configuration of colors

- Replaced raw escapes with colorama
- Added colors key to config
- Add checks for validity of color values

* Add color configuration documentation

* Fix broken tests due to config change

* Add tests for colors in configs

- Identifying invalid color configs
- Upgrading config from no colors -> colors

* Add colorama dependency for all platforms

* Allow users to disable colorization of output

* Update poetry.lock

* Add tag and body color customization options

* Fix colorization of tags in title and body

* Updated tests to use no color by default

* Change pass to continue in verify_config()

* Better style in Entry.py

* Reduce code duplication for tag highlighting

- Breaks "unreadable date" regression test for unknown reason

* Properly colorize tags and print body

* Reformatting and clean up

* Replace list comprehension with generator

* Handle invalid colors by not using a color

* Process ANSI escapes properly with behave

* Fixed the 'spaces after tags directly next to punctuation' bug

Broke processing of tags next to any punctuation at all

* Closer to working tag colorization but not perfect

* Add tests printing for multiline journals

Fix #717

* Correctly indent first line of multiline entry

* Add test for multiline entries with tags

* Remove redundant UNICODE flag

* Progress towards proper tag colorization and body formatting

* Fix newline colorization bug

Debug code left intact since there are more bugs to fix :/

* And now the space just ends up before the tag instead of after it

* Fix assertion syntax warning

* Moved tag test to tagging.feature file

* Strip out debug code and clean up

* Bold datetimes in title

* Bold all titles

Fix #720

* Remove PY2 and PY3 constants

* Fix regression in features/steps/core.py

* Fix tag_regex

* Remove redundant re.UNICODE flag

* Remove extraneous code
2020-04-10 11:51:56 -07:00
Micah Jerome Ellison
6985de2844 Add support to save journals to multiple files in a directory
Update FolderJournal reference to entry __unicode__ method to __str__
Remove DayOne test made obsolete by FolderJournal
Fix FolderJournal path tests for Windows paths
Apply Black linting
2020-04-10 11:51:56 -07:00
Craig Moyer
a3c81d46fe Add support for folder base journal.
Adds feature for issue #170 (and #398) where you configure your journal to
be a directory and entries are added as sub-directories and files:
yyyy/mm/dd.txt. Multiple entries in a day will go in the same file, but a
new entry for a specific day will create a new file (and directory
structure).

Fix failed test scenarios for folder journal.
2020-04-10 11:51:56 -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
MinchinWeb
04f6154c93 Apply black formatter to code
[Travis] add a linting stage (via `black`)
[Travis] update as per code review
Remove "Lint" as separate stage; have `black` check the output rather
than run the re-formmater
2020-04-10 11:51:56 -07:00
Jonathan Wren
46c4c88231 (#770) run black formatter on codebase for standardization 2020-04-10 11:51:56 -07:00
Peter Schmidbauer
8eb185f8a2 Add password confirmation dialog 2020-04-10 11:51:55 -07:00
MinchinWeb
70c946bc13 [Travis] add testing on Windows and Mac
See #739 (Python 3.8), #619 (Windows)
Appease the Travis gods
[Travis] no auto-ruby
[Travis] include a test in not UTC
see #742
[Travis] Add Python to PATH on Windows
[Travis] Windows: try Python 3.7 for cryptography wheels?
[Travis] Windows tests time out
2020-04-10 11:51:55 -07:00
Jonathan Wren
10d8a32b64 Squashed commit of the following:
commit 75113187432939a51486422c3f70b3a9e2bcf0aa
Merge: 74d1854 47e10fb
Author: Jonathan Wren <9453067+wren@users.noreply.github.com>
Date:   Thu Oct 24 17:02:10 2019 -0700

    Merge pull request #665 from notbalanced/issue_662

    Fixes Issue #662 - Day names not treated consistently for new entry

commit 74d1854a4bba468221b4eee254bdee2bb40f5d5a
Merge: 97e4d6a 6a5726a
Author: Jonathan Wren <9453067+wren@users.noreply.github.com>
Date:   Sat Oct 5 15:30:57 2019 -0700

    Merge pull request #418 from philipsd6/2.0-fancy_exporter

    Add exporter to output entries inside unicode box character boxes

commit 47e10fbee7
Author: Craig Moyer <craig.moyer@gmail.com>
Date:   Sun Sep 29 19:06:53 2019 -0400

    Fix issue #662 to properly handle day names as new entry dates and
    command line (-on, -from, -to).

commit 9588913100
Author: Craig Moyer <craig.moyer@gmail.com>
Date:   Sun Sep 29 08:27:27 2019 -0400

    Syncing with jrnl-org/master

commit 4c68eb193d
Merge: 81dfebb 97e4d6a
Author: Craig Moyer <craig.moyer@gmail.com>
Date:   Sun Sep 29 07:52:02 2019 -0400

    Merge remote-tracking branch 'upstream/master' into 2.0-rc1-maebert

commit 81dfebb2c0
Author: Manuel Ebert <manuel@1450.me>
Date:   Mon Apr 29 20:34:18 2019 +0200

    export changes

commit 6a5726acd2
Author: Philip Douglass <philip@philipdouglass.com>
Date:   Fri Dec 22 20:56:36 2017 -0500

    Enable FancyExporter plugin

commit 3d1b226871
Author: Philip Douglass <philip@philipdouglass.com>
Date:   Fri Jan 29 11:17:41 2016 -0500

    Add exporter to output entries inside unicode box character boxes
2020-04-10 11:51:55 -07:00
Aaron Lichtman
1fd1fcc00d Exit jrnl if no text entered into editor
Add test for aborting jrnl entry from editor
Use native mocking
Add comment explaining discrepancy between expected and asserted output
Fix check_empty_output method
Check message on stderr and patch subprocess.call
Add _mock_editor_function
Update features/steps/core.py
Add return from mock function
Add debug statements
Debug
Update features/steps/core.py
Move sys.exit() down
Fix test?
Fix test?
Fix test?
Clean up debug statements
Clean up debug statements
Remove extraneous code
Remove extra space
Add test for empty stdin input
Remove extra debug line
Fix test?
Fix test?
Update features/core.feature
Fix test?
Fix no stdin input test

Co-Authored-By: pspeter <peter.schmidb@gmail.com>
2020-04-10 11:51:55 -07:00
Peter Schmidbauer
9d8d6a83ae remove py2 remnants and use mocks in tests
fstring wip
Run pyupgrade
fix broken pyupgrade fstring
run pyupgrade on plugin dir
fixup! remove py2 remnants and use mocks in tests
small print bugfix
The file=sys.stderr was part of the format(), so an error got printed to
stdout
Drop use of codecs package
Use builtins.open() instead
fixup! remove py2 remnants and use mocks in tests
2020-04-10 11:51:55 -07:00
Jonathan Wren
13631b9a68 Fix issue #584 YAMLLoadWarning (#585) 2020-04-10 11:51:55 -07:00
Manuel Ebert
60a955de20 Template exporting FTW 2016-08-19 23:20:31 +00:00
Manuel Ebert
bdc9dc598d Fix Keyring tests 2016-08-19 21:43:27 +00:00
Manuel Ebert
3408440705 Fix that goddamn timezone test 2015-04-21 16:34:27 +02:00
Manuel Ebert
07fbf73dee Fix for #322 2015-04-21 15:49:27 +02:00
Manuel Ebert
f1907bd27d Fix test arg parsing 2015-04-20 14:12:34 +02:00
Manuel Ebert
539a88ed14 Tests for parsing issue fix 2015-04-05 18:38:37 +02:00
Manuel Ebert
6c18b6f3b4 More encoding madness 2015-04-05 06:38:38 +04:00
Manuel Ebert
6e52b5eb70 Tests for #333 2015-04-05 03:27:09 +04:00
Manuel Ebert
2615070df0 Hardcoded salt to fix crypto 2015-04-04 17:50:44 +11:00
Manuel Ebert
a1b5a4099e Work on cryptography 2014-09-27 13:15:46 -07:00
Manuel Ebert
e75e3d73a0 Converts tests to YAML 2014-09-12 15:28:12 -07:00
Matthias Vogelgesang
ae47c5bb80 Fix failing behave tests 2014-09-12 14:27:34 -07:00
Manuel Ebert
60c03d96d6 Fixes config tests 2014-09-12 14:22:45 -07:00
Matthias Vogelgesang
afae3d16a7 Use PyXDG to save config and journal in XDG dirs
This change also hides the CONFIG_PATH state information entirely within
the install module. Therefore, the cli module does not have to care about
checking existence of files and paths.
2014-09-12 14:20:05 -07:00
Manuel Ebert
1822f50c70 Tests for date parsing and -on 2014-07-21 13:30:36 +09:00
William Minchin
623fc076ad Convert from local util.get_local_timezone() to tzlocal.get_localzone()
one side effect is that a `pytz` object is returned rather than a
string, and so conversion to a string must be done explicitly at run
time where needed.
2014-01-29 09:57:15 -07:00
Manuel Ebert
46951cbe12 More unicode support 2014-01-23 15:14:20 +01:00
Manuel Ebert
bf9adeb28a Tests for new structure 2013-11-29 10:23:16 -08:00
Manuel Ebert
540c298565 Tests for starring 2013-11-03 20:02:28 -08:00
Manuel Ebert
65fab71bef User plain text keyring for testing 2013-10-20 13:30:42 -07:00
Manuel Ebert
13b7d1c1df Tests for storing password in keychain 2013-10-17 16:26:49 -07:00
Manuel Ebert
467f73d377 Better checking for failed runs 2013-08-28 12:36:00 -07:00
Manuel Ebert
1bab646c09 Tests for error messages on empty directories 2013-08-28 12:18:58 -07:00
Manuel Ebert
2a981d51e2 Tests for parsing DayOne entries without Timezone 2013-08-17 13:19:54 -07:00
Manuel Ebert
552d2a00ff Some testing goodies 2013-08-17 12:18:48 -07:00
Manuel Ebert
3549eff215 Adds regression test for #87 2013-08-14 14:00:42 -07:00