test: expand test coverage from 7 to 65 cases - #1
Merged
Conversation
Add tests for all previously untested modules and functions: - _safe_int, parse_process_field (including multi-process/systemd preference logic) - parse_netstat_line (TCP, UDP, header-skip, too-few-fields) - lookup_user and infer_systemd_unit with /proc edge cases (missing, permission denied) - _dedupe_notes (dedup, blank filtering, order preservation) - collect_listening_sockets (ss success, netstat fallback, no tools, stderr note) - collect_docker_containers (not installed, ps failure, successful parse) - collect_inventory (docker skip, note merging, dedup) - render_json, render_table, format_report dispatcher - build_parser flag coverage and main() integration (no-subcommand, file output, flag forwarding) https://claude.ai/code/session_01LFeBf9uLHNE2vu4fodoNnh
proxyBug
marked this pull request as ready for review
June 1, 2026 18:59
This file contains hidden or 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
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.
$(cat <<'EOF'
Summary
cli.py,render_json,render_table,format_report, and all collection-orchestration functionsss,netstat,docker, or/procaccessWhat's new
_safe_intSafeIntTestsparse_process_fieldParseProcessFieldTestsparse_netstat_lineParseNetstatLineTestslookup_userLookupUserTests/proc, PermissionError, uid→name resolutioninfer_systemd_unitInferSystemdUnitTests_dedupe_notesDedupNotesTestscollect_listening_socketsCollectListeningSocketsTestscollect_docker_containersCollectDockerContainersTestscollect_inventoryCollectInventoryTestsrender_jsonRenderJsonTestsrender_tableRenderTableTestsformat_reportFormatReportTestsbuild_parserBuildParserTests--no-docker,--no-systemd,--format,--outputmainMainTestsTest plan
python -m unittest discover -s tests -v→ 65 passed, 0 failedhttps://claude.ai/code/session_01LFeBf9uLHNE2vu4fodoNnh
EOF
)
Generated by Claude Code