Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/const/test_const_apptype_split_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ def test_unassigned_rows_are_documented_rather_than_declared(self) -> None:
with self.subTest(registry=cls.__name__):
self.assertNotIn(-1, [member.port for member in cls])

def test_a_real_port_with_no_transport_no_longer_resolves(self) -> None:
def test_a_real_port_with_no_transport_does_not_resolve(self) -> None:
"""The one deliberate behaviour difference from #732's lookup, pinned.

Some registry entries carry a real port with an **empty** transport
Expand Down Expand Up @@ -982,7 +982,7 @@ def test_no_member_carries_a_multi_transport_proto(self) -> None:
self.assertEqual(AppType.get(888, proto=UDP.__transport__).svc, 'accessbuilder')
self.assertEqual(AppType.get(999, proto=UDP.__transport__).svc, 'applix')

def test_one_transport_protocol_still_resolves_every_port_it_resolved_before(self) -> None:
def test_one_transport_protocol_resolves_every_declared_member(self) -> None:
"""The refusal narrows the composite case and nothing else.

Every declared member of every registry, dispatched from the base under its
Expand Down
24 changes: 12 additions & 12 deletions tests/const/test_const_enum_builtin_parity.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
#: resolves the same way but does not *register* -- its bare ``Unassigned``
#: goes through ``_unregistered_member``, so the resolution is not
#: permanent; see
#: :meth:`ConstEnumRegisterFallbackTests.test_protection_authority_now_
#: :meth:`ConstEnumRegisterFallbackTests.test_protection_authority_
#: resolves_without_extending`. The name is kept for both because this set's
#: own test only checks "does it raise", not "does it grow".
EXPECTED_TO_REGISTER = frozenset({
Expand Down Expand Up @@ -589,7 +589,7 @@ def test_the_other_flag_registry_composes(self) -> None:
does not share Flag semantics with ``Flags``
(:class:`ConstFlagCompositeTests` above) and ``CommandType``; its own,
negative, assertions live in
:meth:`test_transport_protocol_no_longer_composes` below.
:meth:`test_transport_protocol_does_not_compose` below.
"""
from pcapkit.const.ftp.command import CommandType

Expand All @@ -598,7 +598,7 @@ def test_the_other_flag_registry_composes(self) -> None:
with self.assertRaises(ValueError):
CommandType(0x08)

def test_transport_protocol_no_longer_composes(self) -> None:
def test_transport_protocol_does_not_compose(self) -> None:
"""GitHub issue #808: without an ``IntFlag`` base, nothing composes.

Guards against the ``IntFlag`` shape, under which, with power-of-two
Expand Down Expand Up @@ -687,7 +687,7 @@ def tearDown(self) -> None:
# Every test here may register members on module-global classes.
purge_modules(['pcapkit'])

def test_a_string_registry_no_longer_registers_an_unknown_name(self) -> None:
def test_a_string_registry_does_not_register_an_unknown_name(self) -> None:
from pcapkit.const.ftp.command import Command, FEATCode
from pcapkit.const.http.method import Method

Expand Down Expand Up @@ -743,7 +743,7 @@ def test_the_guard_leaves_the_other_lookup_paths_alone(self) -> None:
# probe would not resolve to ``Method.GET`` at all; that behaviour
# is pinned on its own in
# :mod:`tests.const.test_const_enum_no_mint`
# (``BespokeGetUnchangedTests.test_method_get_is_now_case_sensitive``)
# (``BespokeGetOverrideTests.test_method_get_is_case_sensitive``)
# rather than here, where the point is only that the string path
# bypasses the guard this test is about.
self.assertIs(Flags.get('SYN'), Flags.SYN)
Expand Down Expand Up @@ -777,7 +777,7 @@ def test_the_auto_extending_integer_registries_still_extend(self) -> None:
:class:`~pcapkit.const.ipv4.protection_authority.ProtectionAuthority`'s
own unbounded ``_missing_`` resolves any non-negative integer too, but
its label is a bare ``Unassigned``, which the ruling converts; see
:meth:`test_protection_authority_now_resolves_without_extending`.
:meth:`test_protection_authority_resolves_without_extending`.
"""
from pcapkit.const.mh.cga_type import CGAType

Expand All @@ -792,7 +792,7 @@ def test_the_auto_extending_integer_registries_still_extend(self) -> None:
with self.assertRaises(ValueError):
obj(-1)

def test_protection_authority_now_resolves_without_extending(self) -> None:
def test_protection_authority_resolves_without_extending(self) -> None:
"""The counterpart of :meth:`test_the_auto_extending_integer_
registries_still_extend`. Resolves any non-negative integer, but does
not mint a permanent member (#775/#847): a bare ``Unassigned`` is a
Expand All @@ -814,16 +814,16 @@ def test_protection_authority_now_resolves_without_extending(self) -> None:
with self.assertRaises(ValueError):
ProtectionAuthority(-1)

def test_apptype_no_longer_registers_an_unassigned_port(self) -> None:
def test_apptype_does_not_register_an_unassigned_port(self) -> None:
"""GitHub issue #584's machinery, with no mint at ``_missing_``'s
fallthrough or at :meth:`AppType.get`'s own second mint site (GitHub
issue #860 step 2 PR 2, on the same ruling this class's docstring
quotes). 65000 is not in any declared range, so a minting lookup
would leave a permanent ``PORT_65000_tcp`` member every process keeps
forever; it resolves to an equal-but-not-identical unregistered one
instead,
the same shape as :meth:`test_a_string_registry_no_longer_
registers_an_unknown_name` above."""
the same shape as :meth:`test_a_string_registry_does_not_
register_an_unknown_name` above."""
from pcapkit.const.reg.apptype import AppType, TransportProtocol

before = len(AppType.__registries__[TransportProtocol.tcp].__members__)
Expand All @@ -836,7 +836,7 @@ def test_apptype_no_longer_registers_an_unassigned_port(self) -> None:
self.assertEqual(first, second)
self.assertIsNot(first, second)

def test_transport_protocol_can_no_longer_be_extended_at_runtime(self) -> None:
def test_transport_protocol_cannot_be_extended_at_runtime(self) -> None:
"""Maintainer ruling on PR #836: extension refused, not renumbered.

The review ruling on PR #836 removes the registration from
Expand Down Expand Up @@ -1187,7 +1187,7 @@ def test_the_issue_804_templates_render_the_committed_modules(self) -> None:
def test_the_tcp_flags_template_renders_the_committed_module(self) -> None:
"""The whole file, character for character.

Mirrors ``test_the_vendor_templates_still_emit_the_fix`` in
Mirrors ``test_the_vendor_templates_render_the_committed_modules`` in
:mod:`tests.const.test_const_enum_lookup`, which does this for the four
Mobility Header templates. Needs no network: the crawl supplies only the
enumeration block, which is read back out of the committed module.
Expand Down
6 changes: 3 additions & 3 deletions tests/const/test_const_enum_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
defect than the one it replaced.

These modules are generated from :mod:`pcapkit.vendor`, so
``test_the_vendor_template_still_emits_the_fix`` renders the shared template and
``test_the_vendor_template_leaves_get_to_the_base`` renders the shared template and
compares it against a generated module. Without it a regeneration would quietly
undo the fix and the rest of this suite would still pass, because the *tree* is
what is committed and the *template* is what rebuilds it.
Expand Down Expand Up @@ -281,7 +281,7 @@ def test_omitting_the_default_still_raises_for_the_original_key(self) -> None:
# rather than raising at all.
self.assertIs(enum.get(99999, 0), enum(0))

def test_the_two_unverified_enums_from_the_issue(self) -> None:
def test_operation_and_linktype_get_honour_a_default(self) -> None:
"""#584 named ``Operation`` and ``LinkType`` but verified only ``Hardware``."""
from pcapkit.const.arp.operation import Operation
from pcapkit.const.reg.linktype import LinkType
Expand Down Expand Up @@ -429,7 +429,7 @@ def test_filter_type_default_never_resolves_but_key_path_still_uses_an_uncached_

@unittest.skipUnless(importlib.util.find_spec('requests') is not None,
'pcapkit.vendor needs requests')
def test_the_vendor_template_still_emits_the_fix(self) -> None:
def test_the_vendor_template_leaves_get_to_the_base(self) -> None:
"""A regeneration must not undo the fix.

#584's fix lives in :meth:`~pcapkit.corekit.enum.EnumRegistry.get`
Expand Down
2 changes: 1 addition & 1 deletion tests/const/test_const_enum_lookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ def test_the_range_guard_still_rejects(self) -> None:

@unittest.skipUnless(importlib.util.find_spec('requests') is not None,
'pcapkit.vendor needs requests')
def test_the_vendor_templates_still_emit_the_fix(self) -> None:
def test_the_vendor_templates_render_the_committed_modules(self) -> None:
"""A regeneration must not undo the fix.

``pcapkit/const/`` is generated from ``pcapkit/vendor/``, so the
Expand Down
Loading
Loading