Commit graph

1251 commits

Author SHA1 Message Date
Micah Jerome Ellison
819e6a613c Update test w/ new steps
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:43:17 -07:00
Micah Jerome Ellison
b25839be8c Fix annoying poetry-generated Windows line endings
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:43:17 -07:00
Micah Jerome Ellison
009f03f3e1 Install pytest-icdiff and run poetry lock
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:43:17 -07:00
Micah Jerome Ellison
493ae01a7c Fix test failing from lack of whitespace
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:43:17 -07:00
Micah Jerome Ellison
aea7d36900 Implement JSON tests and remove "node" nomenclature from tests
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:43:17 -07:00
Micah Jerome Ellison
5c4d3b8c1b Implement tag tests in JSON
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:43:17 -07:00
Micah Jerome Ellison
1dc45bd7e6 Combine JSON and XML parsing tests
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:43:17 -07:00
Micah Jerome Ellison
ea55005a5d Add JSON parsing test and combine it with XML parsing test
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:43:17 -07:00
Micah Jerome Ellison
c5906b273f Ignore IO errors on Windows
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:43:17 -07:00
Jonathan Wren
b238064f69 Add format tests to pytest-bdd
- Implement cache dir fixture and step
- Implement various steps to check the cache directory (files contained,
  etc)

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:43:17 -07:00
Jonathan Wren
724deb25fa Add encryption test to pytest-bdd
- Clean up some formatting

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:43:17 -07:00
Jonathan Wren
4d7eea7f83 Expand "we run" step to handling input better
- Use regex parser in pytest-bdd to support "we run" steps that also
  have user input ("and enter")

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:43:17 -07:00
Jonathan Wren
4813e2dcc4 Implement "should" and "should not" handling
- Handling should and should not like this should reduce the amount of
  fixtures we need for the test suite
- Add more password tests

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:43:17 -07:00
Jonathan Wren
2c607f3ef7 Add more password tests to pytest-bdd
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:43:17 -07:00
Jonathan Wren
0389af9277 Add more password tests to pytest-bdd
- Fix some input handling in steps (especially for passwords)
- Fix some formatting issues

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:43:17 -07:00
Jonathan Wren
5bc581b2ea Implement password prompt steps in pytest-bdd
- Scaffold some tests that will be added later
- Add fixtures for journal name and keyring type
- Add "we should be prompted for a password" step
- Add "we should not be prompted for a password" step

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:43:17 -07:00
Jonathan Wren
b1a74d3cac Add no keyring encryption test to pytest-bdd
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:43:17 -07:00
Jonathan Wren
c61b05a49d Implement test keyrings and add password tests
- 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>
2021-07-03 15:43:17 -07:00
Jonathan Wren
1634b1806a Fix bug in makefile
- 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>
2021-07-03 15:43:17 -07:00
Jonathan Wren
cecec48754 Update mocks in "we run" step
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:43:17 -07:00
Micah Jerome Ellison
cd7866bc08 Standardize line breaks in datetime tests
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:43:17 -07:00
Micah Jerome Ellison
c5463497ff Migrate the rest of the delete tests from behave to pytest bdd
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:43:17 -07:00
Micah Jerome Ellison
5631c10f2d Add some functioning delete tests
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:43:17 -07:00
Micah Jerome Ellison
65018fe74e Finish migrating datetime.feature to pytest bdd
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:43:17 -07:00
Micah Jerome Ellison
b6aa331a7d Add another unreadable/readable date test
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:43:17 -07:00
Micah Jerome Ellison
293e82d3f8 Add unreadable date test
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:43:17 -07:00
Micah Jerome Ellison
7c2b079b51 Fix local config overwrite when running pytest bdd
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:43:17 -07:00
Micah Jerome Ellison
2b930bcd8f Add unreadable date test
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:43:17 -07:00
Micah Jerome Ellison
fef5d8d50a Add abbreviated weekday test
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2021-07-03 15:43:17 -07:00
Jonathan Wren
5145251166 Expand "we run" step in pytest-bdd
- 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>
2021-07-03 15:43:17 -07:00
Jonathan Wren
ae5406dce2 Rename test functions for clarity
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:43:17 -07:00
Jonathan Wren
80eb5b3008 Implement "the output should be" step
- Add another datetime test

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:43:17 -07:00
Jonathan Wren
51f289797b Re-enable test for windows on python 3.9
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:43:17 -07:00
Jonathan Wren
3f9d1e7036 Add scenario outline test to datetime
- 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>
2021-07-03 15:43:17 -07:00
Jonathan Wren
c8954c8761 Make tests move into temp dir as they run
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>
2021-07-03 15:43:17 -07:00
Jonathan Wren
a1b8cc47be Implement and add datetime tests
- 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>
2021-07-03 15:43:17 -07:00
Jonathan Wren
7a83acb81a Implement version-checking test
- Add new step definition

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:43:17 -07:00
Jonathan Wren
df7a5d016a Add tests for core feature to pytest-bdd
- Implement "the output should contain" step

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:43:16 -07:00
Jonathan Wren
f2f504d04e Rename features directory to data
This is more inline with pytest standards

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:43:16 -07:00
Jonathan Wren
f1397125cd Implement handling of temp and working dirs
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>
2021-07-03 15:43:16 -07:00
Jonathan Wren
61c359c003 Install pytest-bdd (which will eventually replace behave)
- 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>
2021-07-03 15:43:16 -07:00
Jrnl Bot
ace6b8004c Update changelog [ci skip] 2021-07-03 22:22:37 +00:00
Ben Beasley
a9c539821f
Remove useless shebangs and executable permissions (#1283)
* Remove executable permissions from non-script files

* Remove harmless-but-useless shebang lines
2021-07-03 15:20:52 -07:00
Jrnl Bot
5e87ff1ce6 Update changelog [ci skip] 2021-06-05 20:16:47 +00:00
Micah Jerome Ellison
e84bb603eb
Ensure that line endings in all py files are Linux style instead of Windows (#1250) 2021-06-05 13:15:17 -07:00
dependabot[bot]
6fc252b2c7
Bump black from 21.5b1 to 21.5b2 (#1254)
Bumps [black](https://github.com/psf/black) from 21.5b1 to 21.5b2.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-05 13:14:05 -07:00
Jrnl Bot
104fa2caca Update changelog [ci skip] 2021-05-29 18:48:21 +00:00
dependabot[bot]
17c7f4c648
Bump black from 21.5b0 to 21.5b1 (#1244)
Bumps [black](https://github.com/psf/black) from 21.5b0 to 21.5b1.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-29 11:46:46 -07:00
Jrnl Bot
c6815621df Update changelog [ci skip] 2021-05-08 19:40:25 +00:00
dependabot[bot]
b38d765759
Bump black from 20.8b1 to 21.5b0 (#1241)
* Bump black from 20.8b1 to 21.5b0

Bumps [black](https://github.com/psf/black) from 20.8b1 to 21.5b0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/master/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

Signed-off-by: dependabot[bot] <support@github.com>

* Run make format with latest version of black

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-05-08 12:39:00 -07:00