-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Write end-to-end test suite #45
Write end-to-end test suite #45
Conversation
Review appreciated from @jordan-gillard and @GalenReich whenever available :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MAN. So so sorry for the incredibly late review. I promise to follow up much quicker in the future. Hope all is well & happy new year!
47881f0
to
797fc8f
Compare
797fc8f
to
29e3b25
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving.
Since these are system tests I moved them into a dedicated test_end_to_end.py
file.
Thank you for your contribution!
Thanks @jordan-gillard ! |
Closes Issue #11
Replaces PR #39 (which I will close unmerged after creating this).
This PR introduces two unit tests that provide end-to-end coverage for the RSS and SEC search functionality. Both tests operate by executing a simple CLI command and verifying that the output file is:
To maintain tidiness, the
patch
decorator is used to prevent actual output files from being created during testing. These tests ensure that any application relying on edgar-tool's data structure will remain unaffected by internal changes to theedgar-tool
logic.Notes
Test Warnings Instead of Failures
These tests may fail due to external factors, such as:
To address this, the tests issue warnings instead of outright failures. This prevents us from being blocked by unit test failures caused by changes outside the scope of the
edgar-tool
code.Question: Is this approach too lenient?
Asserting Actual Values vs. Structure
While we discussed asserting actual values in the returned data, this could result in overly rigid tests. Changes to the SEC’s backend could cause slight variations in return values, making strict assertions problematic.
Instead, I propose a middle ground: asserting only the correctness of the data structure. This approach is particularly necessary for the RSS feed, where data changes frequently.
For older SEC data, we might expect greater stability, but I am not confident enough to assert this. I'm open to revisiting this approach if desired.
Future Changes Related to Create new URL encoding function to align with SEC API #40
The changes in Create new URL encoding function to align with SEC API #40 are currently in progress. While the URL generation code resides in
edgar_tool\url_generator.py
, it has not yet been integrated intoedgar_tool\cli.py
.A future PR will cut over text-search functionality to use the new
url_generator
.The tests introduced in this PR do not duplicate any functionality that would become redundant after the cutover. Instead, they ensure that the output data structure remains unchanged following this update.