Repository navigation
refactor(toolkit): make tcp_segment and its result type public in toolkit.pcap (#1570) - #1579
Merged
Merged
Conversation
…lkit.pcap (#1570) toolkit/pcapng.py imported the private _tcp_segment from toolkit/pcap.py. Under the #1519 rulings, as #1525 did for test_start_line, the shared helper becomes public in the module both callers already import. - pcap.py: _tcp_segment is now tcp_segment, and its result type _TCPSegment is now TCPSegment; both are in __all__, bodies unchanged. - pcapng.py: imports and calls tcp_segment. - docs: builtin.rst documents both under PCAP Tools in an Auxiliary Functions subsection, as 3rdparty.rst lays out its pages; block2frame moves into one under PCAP-NG Tools. - tests: test_pcap_tcp_segment_public_1570_unit.py pins __all__, the shared object, the NamedTuple fields, the helper on PCAP and PCAP-NG frames, and that all four TCP adapters call it. Neither name is re-exported from pcapkit.toolkit.
Owner
Author
|
Verdict: GOOD TO GO at
For your information, non-blocking:
|
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.
Please follow the guide below
You will be asked some questions, please read them carefully and answer honestly
Put an
xinto all the boxes [ ] relevant to your pull request (like that [x])Use Preview tab to see how your pull request will actually look like
Searched for similar pull requests
Followed the coding style (
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeAdded a changelog entry under
docs/source/changelog/and regeneratedCHANGELOG.md, if the change is user-visible — N/A — centralised in docs(changelog): shared 1.5.0 changelog — long-lived, merges last (#610, #616, #617, #618, #620) #657What is the purpose of your pull request?
Tick the commit type your subject line carries.
fix— corrects a defectfeat— adds a featureperf— changes performance, not behaviourrefactor— changes neither behaviour nor performancetest— tests onlydocs— documentation onlyci— workflows or build toolingrelease— bumps the version or rolls up a distributionchore— anything elseDescription of your pull request and other information
test_start_lineruling (refactor(http): move test_start_line and its patterns into the http base module (#1519) #1525). The shared helper becomes public in the module both callers already import, so it stays intoolkit/pcap.py, whichtoolkit/pcapng.pyimports at top level. No new module and no import cycle._tcp_segment→tcp_segmentand_TCPSegment→TCPSegment. The type is exposed as the helper's return type, so both are now inpcap.__all__. The bodies are unchanged. Neither is re-exported frompcapkit.toolkit, whichpcapkit.allstar-imports.pcapng.pyimportstcp_segmentand uses it at both call sites.toolkit/builtin.rstdocuments both under PCAP Tools in an "Auxiliary Functions" subsection, the layout3rdparty.rstuses.block2framemoves into one under PCAP-NG Tools. The Sphinx build gives no warnings from these pages.tests/toolkit/test_pcap_tcp_segment_public_1570_unit.pyhas 6 tests, modelled ontests/interface/test_registry.py. It pins__all__, the shared object, the fields, the helper on PCAP and PCAP-NG frames, and that all four TCP adapters call it. All 6 fail onmain. Coverage ofpcap.pyandpcapng.pyis unchanged.Ran one at a time:
tests/toolkit, the TCP reassembly, traceflow and engine-agreement runtime tests,test_public_api.py,test_isort_clean.py,test_docstring_contract.py. All green.Closes #1570