Add unit test for sequential POST requests to /set_data with random data validation #17
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.
PR Description: Add Unit Test for /set_data API Route
Summary
This PR adds a unit test to
src/tests/mod.rs
to verify the behavior of the/set_data
API route. The test sends 3 sequential POST requests with random data to the same address and ensures the response contains all previously sent data entries. This ensures the API correctly accumulates and returns data across multiple requests.Context
The
/set_data
route is expected to store and return all data entries sent to it. This test validates that the API behaves as intended when handling multiple requests with new, random data. The test uses a test-specific database and filter instance to isolate the test environment.Testing Instructions
cargo test
.test_set_data_multiple_requests
passes.Known Issues/Limitations
/set_data
route is already implemented and functional.