Add unit tests for output_names in map_rows and _is_directory in io.py to improve code coverage #388
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 test cases to cover previously untested lines in
core.py
andio.py
. This resolves the code coverage gaps identified in PR #385.Changes
Test cases for
map_rows()
in core.pyAdded two test cases in
test_map_rows()
to exercise theoutput_names
parameter:String output_names test: Tests the case where
output_names
is provided as a single string (e.g.,output_names="max_c"
), which tests the automatic conversion from string to list.List output_names test: Tests the case where
output_names
is provided as a list with custom column names (e.g.,output_names=["custom_max1", "custom_max2"]
), which tests the column renaming functionality.These tests complement the existing test that validates the error case when
output_names
length doesn't match the number of output columns.Test cases for
_is_directory()
in io.pyAdded comprehensive test cases in
test__is_directory()
to cover lines 197 and 201:Coverage Impact
Testing
All existing tests continue to pass, and the new tests verify:
output_names
output_names
_is_directory
correctly identifies directories with Path objects_is_directory
correctly identifies directories with string paths_is_directory
returns False for non-directory inputs and invalid typesOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.