Skip to content

🧪 Test header raw modifications#146

Merged
ffalcinelli merged 2 commits into
mainfrom
test-header-raw-modifications-2581065931698872938
Jun 21, 2026
Merged

🧪 Test header raw modifications#146
ffalcinelli merged 2 commits into
mainfrom
test-header-raw-modifications-2581065931698872938

Conversation

@ffalcinelli

Copy link
Copy Markdown
Owner

🎯 What: The testing gap addressed
The codebase had untested paths in pydivert/packet/header.py for the setter of raw inside the Header class, as well as raw, payload, src_port, and dst_port inside RawProtocol, PayloadMixin, and PortMixin.

📊 Coverage: What scenarios are now tested
A new test called test_header_raw_modification was added in pydivert/tests/test_packet.py. It tests:

  • Replacing the raw bytes of an ipv4 header with bytes of the exact same length.
  • Replacing the raw bytes of an ipv4 header with bytes of a different length, and ensuring packet_len updates accordingly.
  • A Dummy protocol implementing PortMixin and PayloadMixin was written to test the specific byte manipulation logic isolated from concrete Header overrides.

Result: The improvement in test coverage
pydivert/packet/header.py now receives thorough test coverage on all these previously unverified paths, and their associated # pragma: no cover statements have been safely removed.


PR created automatically by Jules for task 2581065931698872938 started by @ffalcinelli

Co-authored-by: ffalcinelli <1167082+ffalcinelli@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Co-authored-by: ffalcinelli <1167082+ffalcinelli@users.noreply.github.com>
@codecov

codecov Bot commented Jun 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.47%. Comparing base (51364d0) to head (1d22b08).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #146   +/-   ##
=======================================
  Coverage   98.46%   98.47%           
=======================================
  Files          20       20           
  Lines        2350     2356    +6     
  Branches      216      218    +2     
=======================================
+ Hits         2314     2320    +6     
  Partials       36       36           
Files with missing lines Coverage Δ
pydivert/packet/header.py 97.91% <100.00%> (+0.29%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ffalcinelli ffalcinelli merged commit db1b99e into main Jun 21, 2026
18 checks passed
@ffalcinelli ffalcinelli deleted the test-header-raw-modifications-2581065931698872938 branch June 21, 2026 04:39
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.

1 participant