Daily Test Coverage Improver: Add comprehensive DataUtil module tests #51
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.
Summary
This PR adds comprehensive test coverage for the DataUtil module, which previously had 0% test coverage. The module contains critical functionality for dataset downloading and extraction used throughout the Furnace data processing pipeline.
Changes Made
New Test Methods (7 total)
TestDataUtilDownloadExistingFile - Tests download function behavior when target file already exists (should skip download and preserve existing content)
TestDataUtilExtractTarStream - Tests TAR stream extraction functionality from in-memory data to filesystem, including proper file creation and content verification
TestDataUtilExtractTarStreamEmptyHeader - Tests TAR extraction with empty/null header to ensure graceful handling of malformed archives
TestDataUtilExtractTarGz - Tests complete TAR.GZ file extraction workflow including GZip decompression and TAR parsing
TestDataUtilPrintVal - Tests scalar value printing utility for different data types (float32, int32, bool) with proper formatting
TestDataUtilToPython - Tests Python code generation utility from .NET values, including boolean conversion and tensor handling
TestDataUtilRunScript - Tests external script execution utility for Python plotting integration
Coverage Impact
Target Areas:
Functions Tested:
download- File downloading with skip logicextractTarStream- TAR stream processingextractTarGz- Compressed archive extractionprintVal- Scalar formattingtoPython- Code generationrunScript- External process executionTechnical Details
Test Design Patterns
usedisposable patternsDirectory.Delete(tempDir, true)Benefits
Validation Commands
To verify coverage improvements locally:
Future Improvements
Areas identified for additional test coverage: