Commit graph

9 commits

Author SHA1 Message Date
d0280ea9ad
Add test coverage for WriteToTempFile method
Implemented unit tests for WriteToTempFile, including successful writing to a temporary file and failure cases due to an invalid TMPDIR. These tests ensure the method behaves correctly under different conditions and enhances code robustness.
2024-10-28 18:52:02 +01:00
c28bd7e331
Prevent Test Execution Without Env Variable
Added a check for the "PERFORM_UNIX_OPEN_WRITE_TESTS" environment variable to conditionally skip tests. This ensures tests are only executed when the variable is set to "true". Additionally, commented out the TestMsg_WriteToTempFileFailed function.
2024-10-28 17:42:18 +01:00
4ecc6f2b0c
Refactor Msg tests and remove unused code
Reorganized message writing tests to create more concise and specific scenarios, including new context tests and WriteToFile tests. Removed outdated and redundant test cases to streamline the test suite.
2024-10-28 17:14:06 +01:00
759452f346
Refactor tests to remove redundant unix-specific cases
Unified the test cases for AttachFile, AttachReader, AttachReadSeeker, EmbedFile, EmbedReader, and EmbedReadSeeker by incorporating the previously separate UNIX-specific tests into the general test files. This change enhances maintainability by reducing code duplication and ensuring more consistent test coverage across platforms.
2024-10-28 15:42:20 +01:00
f48ff6e150
Add tests for embedding functionalities in Msg
Introduce unit tests for EmbedReadSeeker, EmbedHTMLTemplate, EmbedTextTemplate, and EmbedFromEmbedFS methods in the Msg package. These tests cover various use cases and error scenarios, ensuring the correct handling of embedded content.
2024-10-28 12:17:20 +01:00
c395c83a06
Add tests for embedding files and readers
Introduced unit tests to verify the embedding of files and readers in messages, including tests specific to Unix file handling scenarios. These tests ensure correct handling of embed errors and proper cleanup of temporary files.
2024-10-28 12:01:31 +01:00
466c2892bf
Add AttachReadSeeker tests for Unix and general cases
Introduce tests for the AttachReadSeeker method, detailing scenarios for general use and Unix-specific paths. Ensure file handling and error conditions are properly validated to maintain robustness.
2024-10-28 09:34:05 +01:00
c0c4049964
Enable Unix write tests and fix OS version matrix.
Added a test environment variable to control Unix write tests and included their setup in the test function. Also corrected the OS version matrix by uncommenting '14.0' and '13.4'.
2024-10-27 20:59:24 +01:00
6a43cf4aaf
Rename and update tests for UNIX-specific functionality
Renamed `msg_nowin_test.go` to `msg_unix_test.go` to better reflect its purpose. Updated the file attachment test to use `/dev/mem` for Unix environments instead of a temporary file with restricted permissions, ensuring compatibility with continuous integration environments.
2024-10-27 20:46:16 +01:00
Renamed from msg_nowin_test.go (Browse further)