Skip to content

Commit c2f1089

Browse files
authored
docs: #1103 round 10 -- close the whole-repo prose sweep (#2432)
Round 10, the closing-condition test: a full re-grep across the entire repo found exactly 3 items, all outside the carve-outs round 9 already settled. * pcapkit/protocols/protocol.py + foundation/registry/protocols.py: RegistryError said "protocol must be a Protocol subclass" while the adjacent issubclass() check and the Raises: docstring both say ProtocolBase -- fixed the message text to match, with the three test assertions that locked the old string. * tests/foundation/reassembly/test_deferred_pickle_2423_unit.py: a docstring said "this pull request's earlier commit", stale now that #2424 landed as one squashed commit on main -- reworded to cite the issue instead of the PR's own history. * tests/protocols/transport/test_tcp_mptcp_option_attr_2293_unit.py: a cross-reference cited the nonexistent module pcapkit.corekit.fields.enums.EnumField; the real path is pcapkit.corekit.fields.numbers.EnumField. No executable logic changed: an AST structural diff (ignoring string constants) against origin/main is identical for every touched file, and the RegistryError fix only changes the text of a raised message, not what triggers it. Re-verified and rejected two relayed findings that didn't survive a direct check: a transport.py:188-189 and a registry/protocols.py:370 cross-reference claim both already read correctly on this base. Re-swept vendor/process() for siblings of #2429/#2430 -- none found. docs/source and the rest of tests/ came back clean. Build: tests/protocols/test_register_class_guard_unit.py, tests/foundation/registry/test_protocols.py, tests/foundation/reassembly/test_deferred_pickle_2423_unit.py, tests/protocols/transport/test_tcp_mptcp_option_attr_2293_unit.py and tests/project/test_docs_issue_pr_roles_1103_unit.py pass. Closes #1103.
1 parent 857bd52 commit c2f1089

6 files changed

Lines changed: 9 additions & 9 deletions

File tree

‎pcapkit/foundation/registry/protocols.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ class rather than supplied by a caller, and this function is the funnel
221221
if not isinstance(protocol, type):
222222
raise RegistryError(f'protocol must be a class, not {protocol!r}')
223223
if not issubclass(protocol, ProtocolBase):
224-
raise RegistryError(f'protocol must be a Protocol subclass, not {protocol!r}')
224+
raise RegistryError(f'protocol must be a ProtocolBase subclass, not {protocol!r}')
225225

226226
name = protocol.__name__.upper()
227227
incumbent = protocol_registry.get(name)

‎pcapkit/protocols/protocol.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1139,7 +1139,7 @@ def _next_layer_entry(cls, code: 'Any', protocol: 'ModuleDescriptor[ProtocolBase
11391139
if not isinstance(protocol, type):
11401140
raise RegistryError(f'protocol must be a class, not {protocol!r}')
11411141
if not issubclass(protocol, ProtocolBase):
1142-
raise RegistryError(f'protocol must be a Protocol subclass, not {protocol!r}')
1142+
raise RegistryError(f'protocol must be a ProtocolBase subclass, not {protocol!r}')
11431143
return protocol
11441144

11451145
@classmethod

‎tests/foundation/reassembly/test_deferred_pickle_2423_unit.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,9 @@ def test_setstate_accepts_the_native_default_shape(self) -> None:
244244
def test_setstate_still_accepts_the_first_revisions_flat_shape(self) -> None:
245245
"""The flat ``{slot: value}`` shape the very first fix returned.
246246
247-
Never released, but already pushed to this pull request's earlier
248-
commit -- accepting it costs nothing and protects anyone who
249-
pickled against that commit.
247+
Never released, but already pushed in an earlier revision of
248+
:issue:`2424`'s fix -- accepting it costs nothing and protects anyone
249+
who pickled against that revision.
250250
251251
"""
252252
from pcapkit.foundation.reassembly.data.data import Deferred

‎tests/foundation/registry/test_protocols.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ def test_register_protocol_rejects_a_non_class_with_registry_error(self) -> None
438438
('none', None, 'must be a class'),
439439
('descriptor argument (not unwrapped here)',
440440
ModuleDescriptor('pcapkit.protocols.misc.raw', 'Raw'), 'must be a class'),
441-
('wrong class', object, 'Protocol subclass'),
441+
('wrong class', object, 'ProtocolBase subclass'),
442442
):
443443
with self.subTest(value=label):
444444
with self.assertRaises(RegistryError) as caught:

‎tests/protocols/test_register_class_guard_unit.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def test_wrong_class_still_raises_registry_error(self) -> None:
8282
with mock.patch.dict(klass.__proto__):
8383
with self.assertRaises(RegistryError) as caught:
8484
klass.register(code, dict) # type: ignore[arg-type]
85-
self.assertIn('Protocol subclass', str(caught.exception))
85+
self.assertIn('ProtocolBase subclass', str(caught.exception))
8686

8787
def test_descriptor_naming_a_non_class_raises_registry_error(self) -> None:
8888
from pcapkit.corekit.module import ModuleDescriptor
@@ -107,7 +107,7 @@ def test_descriptor_naming_a_wrong_class_still_raises_registry_error(self) -> No
107107
with mock.patch.dict(klass.__proto__):
108108
with self.assertRaises(RegistryError) as caught:
109109
klass.register(code, descriptor) # type: ignore[arg-type]
110-
self.assertIn('Protocol subclass', str(caught.exception))
110+
self.assertIn('ProtocolBase subclass', str(caught.exception))
111111

112112
def test_valid_class_and_descriptor_still_register(self) -> None:
113113
from pcapkit.corekit.module import ModuleDescriptor

‎tests/protocols/transport/test_tcp_mptcp_option_attr_2293_unit.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
exactly ``kind`` and ``length`` (#541) and every concrete subtype adds its own on top; none of
1616
them declares ``option``, under :data:`~typing.TYPE_CHECKING` or otherwise. So the assignment
1717
created an attribute out of nothing at unpack time, and nothing in ``pcapkit`` read it back:
18-
``kind``, a real :class:`~pcapkit.corekit.fields.enums.EnumField`, already carries
18+
``kind``, a real :class:`~pcapkit.corekit.fields.numbers.EnumField`, already carries
1919
:attr:`~pcapkit.const.tcp.option.Option.Multipath_TCP`, and it is ``kind`` that the schema
2020
packs.
2121

0 commit comments

Comments
 (0)