Skip to content

Conversation

@darth-raijin
Copy link
Contributor

Strengthen test invariants for file_stream.rs by deriving values where possible and replacing magic values with constants.

Motivation

To improve test quality and reduce brittleness when changing test data, this PR updates the response_not_set_filename test to derive values (like content-length) from the test payload and to use existing constants (like mime types and headers).

Solution

  • Define file_content and size once at the top of the test to enable reuse for assertions and usage in the /file handler
  • Replace hard coded header names, with constants from http::header
  • Replace hard coded MIME string with constant from mime

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.

1 participant