From adfd2104392f470e750d5a0d48fdd5cac40e9878 Mon Sep 17 00:00:00 2001 From: Jarry Shaw Date: Thu, 1 Oct 2026 16:45:46 -0400 Subject: [PATCH] test(prose): correct a stale PR state and two issue/PR mislabels Three factual errors in test prose, found while surveying #NNN citations under tests/ for #719: - test_http_unit.py:2356-2365 claimed PR #457 was "still-open" and that the SETTINGS round trip "remains unreachable until that lands". Both were stale: #457 merged 2026-09-18, the `httpv2-frame/SETTINGS` key no longer exists in `EXPECTED_FAILURES` (verified by importing it: 43 keys, only httpv2 key is PRIORITY), and the round trip itself passes (reproduced: `httpv2.roundtrip()` reports 'OK' for that case). Rewrote the paragraph: the round trip works; what still raises `KeyError: 'flags'` is a bare `SettingsFrame(...).pack()` with no enclosing packet (reproduced directly), which is an unsupported invocation, not a round-trip defect. Cited `FrameType.post_process` by name rather than the stale `httpv2.py:144` line number (the real raise is at `packet['flags'][name]`, confirmed by traceback). `GH-445` is left alone -- it is this repo's own issue shorthand, used throughout pcapkit/ and tests/, and #445 is in fact an issue. - test_base_class_contract.py:45 called #547 and #570 "issues"; both are pull requests. - test_const_str_payload_870_unit.py:12 called #869 a "GitHub issue"; it is a pull request. No behaviour or citation-style changes -- tests/** is exempt from the #719 PR-citation rule. Ran each file individually under pytest and plain unittest (all three use subTest): 6/6, 7/7, 60/60 passed both ways. --- tests/const/test_const_str_payload_870_unit.py | 2 +- tests/protocols/application/test_http_unit.py | 17 ++++++++--------- tests/test_base_class_contract.py | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/tests/const/test_const_str_payload_870_unit.py b/tests/const/test_const_str_payload_870_unit.py index b550018f9a..bd0e361ecd 100644 --- a/tests/const/test_const_str_payload_870_unit.py +++ b/tests/const/test_const_str_payload_870_unit.py @@ -9,7 +9,7 @@ ``str(Method.GET) == ''``, ``len(str(Method.GET)) == 0`` and, most visibly, ``Method.GET == 'GET'`` was :data:`False` for every one of the 40 declared members. True on ``main`` at ``60b85e3a4`` (measured), and true since the class -was first written -- GitHub issue #869 fixed the same inconsistency for an +was first written -- GitHub pull request #869 fixed the same inconsistency for an *unregistered* member's own str payload (:meth:`~pcapkit.const.http.method.Method._unregistered_member` now calls the base's :meth:`~pcapkit.corekit.enum.EnumRegistry._unregistered_member`, which diff --git a/tests/protocols/application/test_http_unit.py b/tests/protocols/application/test_http_unit.py index 7dba7830bf..ffc403d13a 100644 --- a/tests/protocols/application/test_http_unit.py +++ b/tests/protocols/application/test_http_unit.py @@ -2354,15 +2354,14 @@ def test_settings_frame_settings_field_wraps_item_schema(self) -> None: ``SettingPair`` instance. This is a unit-level check on the field wiring, not an end-to-end - ``HTTPv2`` round trip: the SETTINGS frame's pack path still dies - earlier on ``KeyError: 'flags'``, raised by ``FrameType.post_process`` - at ``schema/application/httpv2.py:144`` where it reaches the enclosing - header's ``flags`` field through a nested packet context that cannot - see it (GH-445, fixed by the still-open PR #457), so a real - ``SettingsFrame.pack()``/``HTTPv2(...).make()`` round trip through this - field remains unreachable until that lands. The - ``httpv2-frame/SETTINGS`` entry in ``EXPECTED_FAILURES`` records that - same ``KeyError: 'flags'``. + ``HTTPv2`` round trip. The round trip itself now passes -- there is + no ``EXPECTED_FAILURES`` entry for ``httpv2-frame/SETTINGS``, and + the generator's own round trip for it reports ``OK``. What a round + trip never exercises is a bare ``SettingsFrame(...).pack()`` called + with no enclosing packet: that still raises ``KeyError: 'flags'``, + from ``FrameType.post_process``'s ``packet['flags'][name]`` lookup, + which has no ``flags`` to read without a real header above it. That + is an unsupported invocation, not a defect in the round trip. """ from pcapkit.corekit.fields.misc import SchemaField from pcapkit.protocols.schema.application.httpv2 import SettingPair, SettingsFrame diff --git a/tests/test_base_class_contract.py b/tests/test_base_class_contract.py index d59fdfea6e..ef398484c0 100644 --- a/tests/test_base_class_contract.py +++ b/tests/test_base_class_contract.py @@ -42,7 +42,7 @@ :class:`RegistrationGateTests` is a regression pin, not a new behaviour. Every assertion in it already held before part (c), because parts (a) and (b) -(issues #547 and #570) made registration opt-in on a keyword. It is written down +(pull requests #547 and #570) made registration opt-in on a keyword. It is written down because the ruling promotes it from an accident of where the hook happens to live into the specification, and an unasserted specification is one refactor away from being untrue. The property worth noticing is the last one: a library-style