Skip to content

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.

3 participants