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.
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.