Skip to content

test: add core network and python resolver test coverage#9

Open
Jaydeep869 wants to merge 1 commit intoSBOMit:masterfrom
Jaydeep869:issue-7-network-tests
Open

test: add core network and python resolver test coverage#9
Jaydeep869 wants to merge 1 commit intoSBOMit:masterfrom
Jaydeep869:issue-7-network-tests

Conversation

@Jaydeep869
Copy link
Copy Markdown
Contributor

Description:
This PR introduces critical test coverage for the new network trace attestation support, mitigating previously absent coverage for sbomit's unique feature.

Fixes #7

Scope of Changes:

  • Phase 1 (Core Infrastructure): Added pkg/resolver/network/network_test.go to thoroughly test ExtractConnections, domain based routing hooks, connection struct parsing, and PURL deduplication.
  • Phase 2 (Python Ecosystem): Added pkg/resolver/network/python_test.go to test PyPI URL parsing (files.pythonhosted.org), package name/version extraction, and validation of success vs. failed HTTP statuses.
  • Test Data: Implemented realistic mock structures derived directly from test/sample-attestation.json.

Checklist:

  • All tests pass (go test ./pkg/resolver/network/...)
  • ExtractConnections function is fully tested
  • Python network resolver is comprehensively tested
  • Tests use realistic attestation data structure
  • Mock/fixture data is clean and maintainable
  • Tests are well-documented

Fixes SBOMit#7 (or the corresponding issue).
Adds network_test.go to cover ExtractConnections and Domain Resolver logic.
Adds python_test.go to cover Python PyPI domains URL parsing.

Signed-off-by: jaydeep869 <jaydeeppokhariya2106@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add unit tests for network resolvers

1 participant