Skip to content
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

Add unit test for sequential /set_data requests with random data in src/tests/mod.rs #16

Closed
wants to merge 1 commit into from

Conversation

Sophie-Ag00001
Copy link
Collaborator

# Add Unit Test for Sequential `/set_data` Requests

## Summary
This PR adds a unit test to `src/tests/mod.rs` to verify that sequential requests to the `/set_data` API route with new, random data each time return cumulative results. The test ensures that the response contains all data entries sent in previous requests.

## Motivation
The test was added to validate the behavior of the `/set_data` endpoint when handling multiple sequential requests. This ensures that the API correctly accumulates and returns all data entries, which is critical for maintaining data integrity and consistency.

## Context
The `/set_data` route is expected to store and return all data entries sent in previous requests. This test verifies that the endpoint adheres to this requirement by sending three requests with random data and checking the response.

## Testing Instructions
1. Run the test suite using `cargo test`.
2. Verify that the new test `test_sequential_set_data_requests` passes.
3. Ensure no other tests are affected by this change.

## Known Issues/Limitations
- The test assumes that the `/set_data` endpoint is already implemented and functional.
- Random data generation is limited to the scope of the test and does not cover all edge cases.

… with new, random data each time to the same address on the /set_data api route. The response should contain all data entries that were sent and fail otherwise. Only work on src/tests/mod.rs, no other files
@Sophie-Ag00001 Sophie-Ag00001 requested a review from a team as a code owner January 25, 2025 15:22
@BHouwens BHouwens closed this Jan 25, 2025
@BHouwens BHouwens deleted the sophie/test-set-data-route-responses branch January 25, 2025 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants