Repository navigation
fix(protocols): _make_data returns keys make() does not accept (Frame ts_src, L2TPv2 prio) - #1115
Merged
Merged
Conversation
… ts_src, L2TPv2 prio) Frame._make_data returned ts_src and L2TPv2._make_data returned prio, where make() takes ts_sec and priority, so from_data discarded the field with an UnknownFieldWarning. Rename both keys. Add tests/protocols/test_make_data_keys_unit.py with a from_data round-trip per protocol. Update the tests that pinned the old keys, and rebase the from_data-warns case on a contrived subclass. Closes #1097
Owner
Author
|
Cross-review verdict on
Follow-ups, filed separately:
|
This was referenced Oct 6, 2026
Contributor
|
Coverage: 88.74% (unit tier, Python 3.14,
Per-file detail: the |
3 of 5 tasks
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.
make pylint,make mypy,make isort): ran those tools with the Makefile flags on the two source files. mypy is clean, isort is clean, and pylint reports only pre-existing line-too-long/redefined-builtin, none on the changed linesmake testpasses, and a test case covers the change: ran the 7 modules listed below plustests/project(not the full suite)What is the purpose of your pull request?
fix— corrects a defectDescription of your pull request and other information
Closes #1097. Renames
Frame._make_datats_src→ts_secandL2TPv2._make_dataprio→priority, so the keys matchmake().Probe. Before: L2TPv2
810200010002→from_data→800200010002, warningdiscarded: 'prio' (did you mean 'priority'?). After:810200010002, no warning. Frame:'ts_src' (did you mean 'ts_sec'?)before, andts_secpreserved after.Tests. The new
tests/protocols/test_make_data_keys_unit.pychecks a round-trip per protocol. It fails without the fix (2 failed) and passes with it (2 passed). These tests pinned the old keys and are updated:test_link_unit.py:373,test_header_frame_unit.py:186, andtest_construction_keyword_check_unit.py. In the last one, the warns case now uses a contrived subclass, and the recorded table drops Frame and L2TPv2. Per module: make_data_keys 2 passed, header_frame 6, construction_keyword_check 22, link 24, l2tp_version 7, frame_runtime 4, option_roundtrip 6 (none of its entries were mine).tests/project: 379 passed, 1 skipped.Sweep (AST of 29
_make_datavsmake()and declared keywords). Still mismatched, out of scope:Headermagic_number, and HTTPv2length(not inmake(), but accepted by__init__).