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 POST requests to /set_data with random data validation #17

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Sophie-Ag00001
Copy link
Collaborator

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

  1. Run the test suite using cargo test.
  2. Verify that the new test test_set_data_multiple_requests passes.
  3. Ensure no other tests are affected by these changes.

Known Issues/Limitations

  • The test assumes the /set_data route is already implemented and functional.
  • The test does not cover edge cases such as invalid data formats or large payloads.

… 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 26, 2025 15:00
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