-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
chore: improve tests for multipart messages #422
Merged
wneessen
merged 10 commits into
main
from
chore/420_improve-tests-for-multipart-messages
Jan 19, 2025
Merged
chore: improve tests for multipart messages #422
wneessen
merged 10 commits into
main
from
chore/420_improve-tests-for-multipart-messages
Jan 19, 2025
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This test ensures correct handling and formatting of multipart messages that include a plain text section and a file attachment. It validates headers, boundaries, and content structure to enforce expected message output.
Introduce `checkMessageContent` helper function to simplify and unify validation of message content in tests. This reduces redundancy and improves code readability by reusing a structured approach with the newly introduced `msgContentTest` type.
Replaced FreeBSD 14.0 (EOL) with 14.2 in the GitHub Actions CI workflow. This ensures the tests run against the latest macOS version while maintaining backward compatibility.
Replaced manual response comparison logic with the `checkMessageContent` function for improved clarity and maintainability. This reduces redundancy and simplifies the test's structure while preserving its functionality.
This test verifies the creation and output of a message with both plain text and HTML alternatives, ensuring correct multipart/alternative formatting. It includes checks for headers, boundary markers, and content consistency.
This test validates the `WriteTo` method for a message containing plain text, HTML alternative, an attachment, and an embedded file. It ensures the correct structure and content of the multipart message, enhancing test coverage and reliability.
This test ensures correct handling of S/MIME signed messages containing plain text, HTML alternatives, embedded files, and attachments. It validates the message structure and content, covering scenarios with comprehensive MIME types and signing mechanisms.
Adjusted the formatting of a test case definition to enhance code readability. The change introduces a clearer structure by splitting a long line into a well-organized multi-line format. No functional logic was modified.
Introduced runtime-based file content type handling to account for differences in FreeBSD. This ensures tests correctly reflect platform-specific variations, switching from "text/plain" to "application/octet-stream" when necessary.
Refactored test cases to adjust `Content-Type` based on runtime OS. Removed redundant `charset=utf-8` where it was already covered by the file content type definition, ensuring consistency and correct MIME type handling across platforms.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds more tests for the message processing that writes mails into memory and compares expected values.
This closes #420