Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thanks for the patience on writing this. This is a starting point for a test suite. One challenge was how to make the tests resilient in the event that the SEC and RSS APIs change, or the return payload changes, or the tests are run from a machine without internet access. For this reason, I developed a pattern such that some tests use try-except to try and run an end-to-end test (which includes making a call to the web) and raises a warning, rather than a test failure, if the end-to-end test fails.
I also make use of the patch decorator to suppress behavior like file creation and web calls during testing.
One final issue is that I could not run @jordan-gillard's unit test
tests/test_cli.py::test_cli_should_return_help_string_when_passed_no_args
It seems something about my machine set up (Windows 11) doesn't work with using the subprocess module, but I cannot figure out what and I am using a python 3.11.2 poetry shell as per the instructions. Sorry if I'm missing something obvious but I can't get this one to pass :S . If this works on a testers computer, then perhaps it's just me(?). Because the behavior tested is about the CLI, it makes sense to use subprocess.
All other tests are passing with both pytest and tox. Test coverage is 69% (which is closer to 75% when not counting io.py, which I wanted to avoid testing)
Review and feedback much appreciated. @jordan-gillard and @rkiddy are very welcome to look it over and offer any feedback.
Cheers