diff --git a/tests/const/test_const_apptype_split_unit.py b/tests/const/test_const_apptype_split_unit.py index 5c7f35d243..9de0237c56 100644 --- a/tests/const/test_const_apptype_split_unit.py +++ b/tests/const/test_const_apptype_split_unit.py @@ -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 @@ -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 diff --git a/tests/const/test_const_enum_builtin_parity.py b/tests/const/test_const_enum_builtin_parity.py index 4f46c26ff5..968e31758f 100644 --- a/tests/const/test_const_enum_builtin_parity.py +++ b/tests/const/test_const_enum_builtin_parity.py @@ -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({ @@ -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 @@ -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 @@ -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 @@ -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) @@ -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 @@ -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 @@ -814,7 +814,7 @@ 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 @@ -822,8 +822,8 @@ def test_apptype_no_longer_registers_an_unassigned_port(self) -> None: 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__) @@ -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 @@ -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. diff --git a/tests/const/test_const_enum_get.py b/tests/const/test_const_enum_get.py index 7e7df3af85..c33ae20cd4 100644 --- a/tests/const/test_const_enum_get.py +++ b/tests/const/test_const_enum_get.py @@ -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. @@ -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 @@ -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` diff --git a/tests/const/test_const_enum_lookup.py b/tests/const/test_const_enum_lookup.py index a117cee092..c95477d8c7 100644 --- a/tests/const/test_const_enum_lookup.py +++ b/tests/const/test_const_enum_lookup.py @@ -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 diff --git a/tests/const/test_const_enum_no_mint.py b/tests/const/test_const_enum_no_mint.py index 7b59f118fc..e81134925f 100644 --- a/tests/const/test_const_enum_no_mint.py +++ b/tests/const/test_const_enum_no_mint.py @@ -64,7 +64,7 @@ ruling" argument that converts :class:`Command`'s and :class:`Method`'s own ``get()`` mint sites below; see :meth:`BespokeUnmintConvertedRegistriesTests. -test_optiontype_get_int_path_no_longer_mints`, +test_optiontype_get_int_path_does_not_mint`, ``..._namespace_path_...`` and ``..._str_path_...``. Open-vocabulary registries whose mint used the exact, unmodified observed @@ -542,7 +542,7 @@ def _first_unassigned_value(cls: 'type') -> 'int': #: "Old Xerox Experimental values. Invalid as an Ethertype since 1983." both #: convert, because the label itself says nothing was assigned. Every *other* #: named block -- companies the historical list attributes a real code range -#: to -- converts too (#775); :data:`ETHERTYPE_FORMERLY_KEPT_PROBE` pins one +#: to -- converts too (#775); :data:`ETHERTYPE_ATTRIBUTED_PROBE` pins one #: (``Xyplex``) as a regression guard that it does not mint. #: #: "Old Xerox Experimental" (0x0101-0x01FF) is a strict subset of the wider @@ -570,23 +570,23 @@ def _first_unassigned_value(cls: 'type') -> 'int': #: own constant, distinct from :data:`ETHERTYPE_UNASSIGNED_PROBES`, because #: :class:`EtherTypeMixedMintTests` below wants it named individually in #: its own regression test. -ETHERTYPE_FORMERLY_KEPT_PROBE = (0x0888, 'Xyplex_0x0888') +ETHERTYPE_ATTRIBUTED_PROBE = (0x0888, 'Xyplex_0x0888') #: :class:`~pcapkit.const.ipx.socket.Socket` probes for the owner's #775/#847 #: ruling: ``Experimental`` and the dynamically/statically assigned labels #: convert, as notation for the reader rather than a final concrete assigned #: name. ``Registered by Xerox``, the company one, is pinned by -#: :data:`IPX_SOCKET_FORMERLY_KEPT_PROBE`. +#: :data:`IPX_SOCKET_ATTRIBUTED_PROBE`. IPX_SOCKET_UNASSIGNED_PROBES = { 0x0025: 'Experimental', 0x4001: 'Dynamically Assigned Socket Numbers', 0x8001: 'Statically Assigned Socket Numbers', 0x0BBA: 'Dynamically Assigned', } -#: The mirror of :data:`ETHERTYPE_FORMERLY_KEPT_PROBE` for +#: The mirror of :data:`ETHERTYPE_ATTRIBUTED_PROBE` for #: :class:`~pcapkit.const.ipx.socket.Socket`: ``Registered by Xerox`` also #: converts (#775), keeping its hex-suffixed name. -IPX_SOCKET_FORMERLY_KEPT_PROBE = (0x0010, 'Registered by Xerox_0x0010') +IPX_SOCKET_ATTRIBUTED_PROBE = (0x0010, 'Registered by Xerox_0x0010') def _first_unregistered_value(cls: 'type') -> 'Optional[int]': @@ -1271,7 +1271,7 @@ class UnregisteredMemberNameIsBareTests(unittest.TestCase): :meth:`~pcapkit.const.ftp.command.Command._unregistered_member`'s own docstring documents as the shared convention (see :meth:`BespokeOpenVocabularyUnmintConvertedTests. - test_command_missing_no_longer_mints` and its siblings). Neither + test_command_missing_does_not_mint` and its siblings). Neither argument is *formatted* with a numeric suffix on any of the three, which is the one thing that would risk a genuine ``__members__`` collision if these were ever minted instead of built unregistered. @@ -1430,7 +1430,7 @@ class RulingConversionSourceTests(unittest.TestCase): :data:`_MIXED_REGISTRIES` is empty, so nothing is excluded here -- see its own comment.""" - def test_no_reachable_gap_registries_no_longer_call_extend_enum(self) -> None: + def test_no_reachable_gap_registries_do_not_call_extend_enum(self) -> None: # EtherType belongs to RULING_CONVERTED_WITH_REACHABLE_GAP: its Old # Xerox branch is not shadowed by the wider IEEE802.3 range (GitHub # issue #862), so its first converted branch by source order is @@ -1450,7 +1450,7 @@ def test_no_reachable_gap_registries_no_longer_call_extend_enum(self) -> None: self.assertNotIn('extend_enum', source) self.assertIn('_unregistered_member', source) - def test_every_wholly_converted_registry_no_longer_calls_extend_enum(self) -> None: + def test_every_wholly_converted_registry_does_not_call_extend_enum(self) -> None: for module_name, class_name in RULING_CONVERTED_REGISTRIES: if (module_name, class_name) in _MIXED_REGISTRIES: continue @@ -1459,10 +1459,10 @@ def test_every_wholly_converted_registry_no_longer_calls_extend_enum(self) -> No source = inspect.getsource(cls._missing_) # type: ignore[attr-defined] self.assertNotIn('extend_enum', source) - def test_ethertype_and_socket_no_longer_call_extend_enum_either(self) -> None: + def test_ethertype_and_socket_do_not_call_extend_enum_either(self) -> None: """EtherType and Socket carry no ``extend_enum`` call either (#775), the same invariant - :meth:`test_every_wholly_converted_registry_no_longer_calls_extend_enum` + :meth:`test_every_wholly_converted_registry_does_not_call_extend_enum` proves for the rest -- named separately because Socket is not a member of :data:`RULING_CONVERTED_REGISTRIES`, so the loop above alone would never reach it.""" @@ -1503,7 +1503,7 @@ def test_unassigned_rows_do_not_mint(self) -> None: self.assertEqual(before, len(EtherType.__members__)) self.assertNotIn(value, EtherType._value2member_map_) # type: ignore[attr-defined] - def test_formerly_attributed_vendor_block_no_longer_mints(self) -> None: + def test_an_attributed_vendor_block_does_not_mint(self) -> None: """``Xyplex`` (0x0888), a real attributed name, does not mint (#775): it resolves to an unregistered member with the hex-suffixed name exactly as the crawler renders it -- PR #878 scoped it this way: @@ -1512,7 +1512,7 @@ def test_formerly_attributed_vendor_block_no_longer_mints(self) -> None: :meth:`test_unassigned_rows_do_not_mint` above.""" from pcapkit.const.reg.ethertype import EtherType - value, name = ETHERTYPE_FORMERLY_KEPT_PROBE + value, name = ETHERTYPE_ATTRIBUTED_PROBE self.assertNotIn(value, EtherType._value2member_map_) # type: ignore[attr-defined] before = len(EtherType.__members__) @@ -1534,7 +1534,7 @@ class IPXSocketMixedMintTests(unittest.TestCase): dynamically/statically assigned labels, and #775 converts ``Registered by Xerox``, the company one, too, so ``Socket(0x0010)`` resolves to an unregistered ``Registered by Xerox_0x0010``; see - :meth:`test_registered_by_xerox_no_longer_mints` below.""" + :meth:`test_registered_by_xerox_does_not_mint` below.""" def setUp(self) -> None: reimport_once_per_class(self, restore=True) @@ -1554,16 +1554,16 @@ def test_unassigned_rows_do_not_mint(self) -> None: self.assertEqual(before, len(Socket.__members__)) self.assertNotIn(value, Socket._value2member_map_) # type: ignore[attr-defined] - def test_registered_by_xerox_no_longer_mints(self) -> None: + def test_registered_by_xerox_does_not_mint(self) -> None: """``Registered by Xerox`` (0x0010), the company name, does not mint (#775): it resolves to an unregistered member with the hex-suffixed name exactly as the crawler renders it -- same ruling, same reasoning as :meth:`EtherTypeMixedMintTests. - test_formerly_attributed_vendor_block_no_longer_mints`.""" + test_an_attributed_vendor_block_does_not_mint`.""" from pcapkit.const.ipx.socket import Socket - value, name = IPX_SOCKET_FORMERLY_KEPT_PROBE + value, name = IPX_SOCKET_ATTRIBUTED_PROBE self.assertNotIn(value, Socket._value2member_map_) # type: ignore[attr-defined] before = len(Socket.__members__) @@ -1753,7 +1753,7 @@ def test_optiontype_members_ns_is_not_corrupted(self) -> None: self.assertEqual(first, second) self.assertIsNot(first, second) - def test_optiontype_get_int_path_no_longer_mints(self) -> None: + def test_optiontype_get_int_path_does_not_mint(self) -> None: """Guards against :meth:`OptionType.get` minting directly on a miss (bypassing ``_missing_`` entirely) -- a second, independent mint site, on the wire-facing path @@ -1781,7 +1781,7 @@ def test_optiontype_get_int_path_no_longer_mints(self) -> None: self.assertEqual(first, second) self.assertIsNot(first, second) - def test_optiontype_get_namespace_path_no_longer_mints(self) -> None: + def test_optiontype_get_namespace_path_does_not_mint(self) -> None: """The same call, through a non-default ``namespace=`` -- a different branch of the same ``if isinstance(key, int)`` block.""" from pcapkit.const.pcapng.option_type import OptionType @@ -1802,7 +1802,7 @@ def test_optiontype_get_namespace_path_no_longer_mints(self) -> None: self.assertEqual(first, second) self.assertIsNot(first, second) - def test_optiontype_get_str_path_no_longer_mints(self) -> None: + def test_optiontype_get_str_path_does_not_mint(self) -> None: """The subtler of the two: guards against ``get()``'s ``str``-keyed branch minting ``key`` itself as the member's *name*, with ``default`` as its value -- the same "no information to register one @@ -1858,7 +1858,7 @@ class BespokeOpenVocabularyUnmintConvertedTests(unittest.TestCase): ``tests/protocols/application/test_ftp_unit.py::FTPUnitTests::test_command_get_is_case_insensitive``, which pins exactly that with ``assertEqual``, ``assertIsNot`` and ``assertNotEqual``. Its HTTP counterpart is - ``tests/protocols/application/test_http_unit.py::HTTPUnitTests::test_method_get_is_now_case_sensitive`` + ``tests/protocols/application/test_http_unit.py::HTTPUnitTests::test_method_get_is_case_sensitive`` (#896). """ @@ -1919,7 +1919,7 @@ def test_command_rows_reference_declared_featcode_members(self) -> None: self.assertIs(Command.MLST.feat, FEATCode.MLST) # type: ignore[attr-defined] self.assertIs(Command.MLSD.feat, Command.MLST.feat) # type: ignore[attr-defined] - def test_featcode_missing_no_longer_mints(self) -> None: + def test_featcode_missing_does_not_mint(self) -> None: """The convention pinned across every open-vocabulary class: an unregistered member's *value* is the caller's own casing, unchanged -- ``FEATCode`` never minted any other way, and @@ -1940,7 +1940,7 @@ def test_featcode_missing_no_longer_mints(self) -> None: self.assertIsNot(first, second) self.assertEqual(repr(first), '') - def test_command_missing_no_longer_mints(self) -> None: + def test_command_missing_does_not_mint(self) -> None: """Same convention as :class:`~pcapkit.const.ftp.command.FEATCode`'s: the *value* is exactly what was observed (``value == 'wire casing'`` holds), matching what a mint does for this class -- only the *name* @@ -1968,7 +1968,7 @@ def test_command_missing_no_longer_mints(self) -> None: self.assertEqual(first.conf, ConformanceRequirement.O) self.assertEqual(repr(first), '') - def test_command_get_unknown_no_longer_mints(self) -> None: + def test_command_get_unknown_does_not_mint(self) -> None: """The value keeps the caller's own casing (see :meth:`Command. _unregistered_member`'s own docstring) -- so a repeated call with the *same* casing is equal but not identical, while a *different* @@ -1992,7 +1992,7 @@ def test_command_get_unknown_no_longer_mints(self) -> None: self.assertEqual(different_case, 'PYPCAPKIT860PROBE2') self.assertNotEqual(first, different_case) - def test_method_missing_no_longer_mints(self) -> None: + def test_method_missing_does_not_mint(self) -> None: """Same convention as :class:`~pcapkit.const.ftp.command.FEATCode`'s and :class:`~pcapkit.const.ftp.command.Command`'s: an *unregistered* member's value is the caller's own casing, with real :class:`str` @@ -2025,7 +2025,7 @@ def test_method_missing_no_longer_mints(self) -> None: # caller's own casing shows through in the repr too. self.assertEqual(repr(first), '') - def test_method_get_unknown_no_longer_mints(self) -> None: + def test_method_get_unknown_does_not_mint(self) -> None: """Same convention and same reasoning as :meth:`Command. _unregistered_member`'s -- the value keeps the caller's own casing, so same-casing repeats are equal-not-identical and a @@ -2058,8 +2058,8 @@ def test_registered_lookups_are_still_unaffected(self) -> None: method token :rfc:`9110#section-9.1` covers is case-sensitive (GitHub issue #896), so ``Method.get('get')`` does not resolve to :attr:`Method.GET` -- - see :class:`BespokeGetUnchangedTests`'s - ``test_method_get_is_now_case_sensitive`` for that behaviour + see :class:`BespokeGetOverrideTests`'s + ``test_method_get_is_case_sensitive`` for that behaviour directly. ``Method('GET')`` (the constructor, reaching :meth:`Method._missing_` rather than :meth:`Method.get`) is untouched either way, since #896 is scoped to ``get`` alone. @@ -2072,7 +2072,7 @@ def test_registered_lookups_are_still_unaffected(self) -> None: self.assertIs(Method('GET'), Method.GET) # type: ignore[attr-defined] self.assertIs(Method.get('GET'), Method.GET) # type: ignore[attr-defined] - def test_all_three_carry_the_registry_protocol(self) -> None: + def test_featcode_command_and_method_carry_the_registry_protocol(self) -> None: """#842's ruling is that ``get``/``get_all``/``register``/ ``register_alias`` exist on every registry -- #860 step 2 is what actually delivers that for these three.""" @@ -2138,7 +2138,7 @@ def test_statuscode_get_omitted_default_still_raises(self) -> None: with self.assertRaises(ValueError): StatusCode.get(9999) - def test_statuscode_get_minus_one_is_now_an_ordinary_default(self) -> None: + def test_statuscode_get_minus_one_is_an_ordinary_default(self) -> None: """``-1`` is not the sentinel for *no default* (it is under the retired ``default == -1`` convention); it is just an :class:`int` that -- like any other -- is only honoured if it already names a @@ -2189,7 +2189,7 @@ def test_statuscode_and_returncode_gained_get_all_register(self) -> None: self.assertTrue(callable(getattr(cls, 'register_alias', None))) -class BespokeGetUnchangedTests(unittest.TestCase): +class BespokeGetOverrideTests(unittest.TestCase): """:class:`~pcapkit.const.ftp.command.Command`, :class:`~pcapkit.const.http.method.Method` and :class:`~pcapkit.const.pcapng.option_type.OptionType` keep their own @@ -2206,7 +2206,7 @@ class BespokeGetUnchangedTests(unittest.TestCase): issue #896, over #583's case-insensitive lookup), since RFC 9110 Section 9.1 makes the HTTP method token case-sensitive, unlike FTP's command codes (RFC 959 Section 5.3), so ``Method.get('Get')`` does not return :attr:`Method.GET` - -- see ``test_method_get_is_now_case_sensitive`` below. ``Method`` keeps + -- see ``test_method_get_is_case_sensitive`` below. ``Method`` keeps its own ``get()`` rather than the base's, because it needs to build an unregistered member preserving the caller's own casing on a miss (the base's generic ``get()`` only ever raises or falls back to an @@ -2224,7 +2224,7 @@ class BespokeGetUnchangedTests(unittest.TestCase): def setUp(self) -> None: reimport_once_per_class(self, restore=True) - def test_method_get_is_now_case_sensitive(self) -> None: + def test_method_get_is_case_sensitive(self) -> None: """GitHub issue #896: only the exact registered casing resolves. RFC 9110 Section 9.1 makes the method token case-sensitive, so a @@ -2427,7 +2427,7 @@ def test_named_transport_span_still_dispatches_and_does_not_mint(self) -> None: self.assertEqual(len(TCP.__members__), tcp_before) self.assertEqual(len(UDP.__members__), udp_before) - def test_get_second_mint_site_no_longer_mints(self) -> None: + def test_get_second_mint_site_does_not_mint(self) -> None: """54321 is not a declared member and not inside any of ``_missing_``'s ranges either, so it reaches :meth:`AppType. get`'s own, second, independent mint site -- @@ -2524,7 +2524,7 @@ def test_register_on_apptype_itself_raises(self) -> None: with self.assertRaises(ValueError): AppType.register(1234, 'x') - def test_register_alias_still_works_after_the_sanitizer_refactor(self) -> None: + def test_register_alias_goes_through_the_shared_sanitizer(self) -> None: """:meth:`AppType.register`/:meth:`AppType.register_alias` share :meth:`AppType._sanitize_identifier` rather than each carrying its own copy of the sanitising steps -- this checks the alias path @@ -2621,7 +2621,7 @@ def test_get_still_refuses_an_unrecognised_name(self) -> None: with self.assertRaises(KeyError): TransportProtocol.get('not-a-real-transport') - def test_stale_power_of_two_comment_is_gone(self) -> None: + def test_apptype_source_claims_no_power_of_two_spacing(self) -> None: """Per GitHub issue #860: an in-code comment claiming the values "must keep" power-of-two spacing contradicts the PR #836 ruling that nothing composes a ``TransportProtocol``, so the generated source diff --git a/tests/const/test_const_ipv6_extension_header_925_unit.py b/tests/const/test_const_ipv6_extension_header_925_unit.py index 9466dba894..d0e4e1f598 100644 --- a/tests/const/test_const_ipv6_extension_header_925_unit.py +++ b/tests/const/test_const_ipv6_extension_header_925_unit.py @@ -52,14 +52,14 @@ def _ipv6_bytes(next_code: 'int', ext_and_payload: 'bytes') -> 'bytes': class ExtensionHeaderBitEmuRemovedTests(unittest.TestCase): """There is no ``BIT_EMU``, and the ``ipv6.py`` walk handles 147 cleanly.""" - def test_extension_header_now_has_exactly_eleven_members(self) -> None: + def test_extension_header_has_no_bit_emu_member(self) -> None: from pcapkit.const.ipv6.extension_header import ExtensionHeader names = [member.name for member in ExtensionHeader] self.assertEqual(len(names), 11) self.assertNotIn('BIT_EMU', names) - def test_bit_emu_value_no_longer_resolves(self) -> None: + def test_bit_emu_value_does_not_resolve(self) -> None: # The exact call IPv6._decode_next_layer makes at the # top of its extension-header walk loop. With no BIT_EMU member and no # _missing_ defined on this generated file (neither EnumLookup nor diff --git a/tests/const/test_const_method_case_sensitive_896_unit.py b/tests/const/test_const_method_case_sensitive_896_unit.py index aaf5c6b6ff..5184719357 100644 --- a/tests/const/test_const_method_case_sensitive_896_unit.py +++ b/tests/const/test_const_method_case_sensitive_896_unit.py @@ -52,7 +52,7 @@ This module also pins the crawler and the generated file against each other, the way :mod:`tests.const.test_const_enum_get`'s own -``test_the_vendor_template_still_emits_the_fix`` does for a different +``test_the_vendor_template_leaves_get_to_the_base`` does for a different registry: :mod:`pcapkit.const` is generated from :mod:`pcapkit.vendor`, so a fix applied only to the generated file is silently discarded by the next crawl. Unlike that sibling test, :class:`~pcapkit.const.http.method.Method`'s @@ -222,7 +222,7 @@ def test_command_get_stays_case_insensitive(self) -> None: silently carry the case-sensitive change over to ``Command`` too. It is also the only pin of GitHub issue #582 (``Command.get('abor')`` must resolve), which - :class:`tests.const.test_const_enum_no_mint.BespokeGetUnchangedTests` + :class:`tests.const.test_const_enum_no_mint.BespokeGetOverrideTests` relies on rather than repeating. """ from pcapkit.const.ftp.command import Command diff --git a/tests/const/test_const_registry_protocol.py b/tests/const/test_const_registry_protocol.py index 1c40f2da53..c6b3132c00 100644 --- a/tests/const/test_const_registry_protocol.py +++ b/tests/const/test_const_registry_protocol.py @@ -133,7 +133,7 @@ def test_converted_const_modules_carry_no_copy_of_the_protocol(self) -> None: with self.subTest(registry=name, method=method): self.assertNotIn(f'def {method}(', source) - def test_converted_crawlers_no_longer_spell_their_own_get(self) -> None: + def test_converted_crawlers_do_not_spell_their_own_get(self) -> None: for relpath in CONVERTED_VENDORS: with self.subTest(vendor=relpath): source = (REPO_ROOT / relpath).read_text() @@ -253,7 +253,7 @@ class TCPFlagsConversionTests(unittest.TestCase): def setUp(self) -> None: reimport_once_per_class(self, restore=True) - def test_tcp_flags_now_inherits_the_base(self) -> None: + def test_tcp_flags_inherits_the_base(self) -> None: """Guards against ``Flags`` being a plain ``IntFlag``. Resolves ``EnumRegistry`` freshly from the just-reimported @@ -933,7 +933,7 @@ def test_hardware_still_bounds_and_resolves_its_unassigned_ranges(self) -> None: Hardware.get(65536) self.assertIs(Hardware.get(65536, 1), Hardware.Ethernet) - def test_transtype_no_longer_mints_its_declared_unassigned_range(self) -> None: + def test_transtype_does_not_mint_its_declared_unassigned_range(self) -> None: """:class:`~pcapkit.const.reg.transtype.TransType`'s own ``_missing_`` goes through ``_unregistered_member`` for ``148..252``, not a permanent :func:`~aenum.extend_enum` mint: per the #775/#847 @@ -973,7 +973,7 @@ class RegisterAlreadyRegisteredNowRaisesOnAGeneratedRegistryTests(unittest.TestC def setUp(self) -> None: reimport_once_per_class(self, restore=True) - def test_register_over_a_taken_value_now_raises(self) -> None: + def test_register_over_a_taken_value_raises(self) -> None: from pcapkit.const.reg.transtype import TransType names_before = list(TransType._member_names_) @@ -1171,7 +1171,7 @@ class StrEnumValueFallbackTests(unittest.TestCase): mint regardless of what a subclass's own ``_missing_`` does. """ - def test_a_str_key_that_is_a_value_but_not_a_name_now_resolves(self) -> None: + def test_a_str_key_that_is_a_value_but_not_a_name_resolves(self) -> None: """The defect itself: without the fix, this raises ``KeyError``.""" class _Str(EnumRegistry, StrEnum): KNOWN = 'known-value' @@ -1364,7 +1364,7 @@ def test_identity_survives_an_ordinary_second_import(self) -> None: self.assertIs(module_again.NO_DEFAULT, first_import) - def test_missing_name_with_default_negative_one_is_now_a_real_default(self) -> None: + def test_missing_name_with_default_negative_one_is_a_real_default(self) -> None: """``-1`` and ``-1.0`` are honoured as defaults by :meth:`~pcapkit.corekit.enum.EnumRegistry.get` itself. @@ -1399,7 +1399,7 @@ def test_negative_one_defaults_on_a_shipped_registry_raise_and_mint_nothing(self :exc:`KeyError` propagates, as with no default at all; without #864 the lookup raises :exc:`ValueError` from ``cls(-1)`` instead. This does *not* discriminate #857, which raised the same :exc:`KeyError`; - :meth:`test_missing_name_with_default_negative_one_is_now_a_real_default` + :meth:`test_missing_name_with_default_negative_one_is_a_real_default` does. """ from pcapkit.const.ipv6.extension_header import ExtensionHeader @@ -1456,7 +1456,7 @@ class GetDefaultNoMintTests(unittest.TestCase): def setUp(self) -> None: reimport_once_per_class(self, restore=True) - def test_the_issues_own_case_no_longer_mints_and_raises_instead(self) -> None: + def test_get_with_an_unregistered_default_raises_rather_than_mints(self) -> None: """The exact reproduction from #864, on the real shipped registry. Measured live without #864's fix:: @@ -1471,7 +1471,7 @@ def test_the_issues_own_case_no_longer_mints_and_raises_instead(self) -> None: falls to ``default``; ``0x0888`` (2184) falls inside the ``Xyplex`` range, which resolves without minting when reached as a ``key`` (#775; see - :meth:`GetDefaultNoMintTests.test_key_path_minting_is_preserved`). + :meth:`GetDefaultNoMintTests.test_key_path_resolves_without_minting`). Without #864's fix the lookup reaches ``cls(default)``; with it, ``default`` does not reach ``cls(default)`` at all, so ``0x0888`` not being an *already-registered* value propagates the ``0x1234`` @@ -1490,7 +1490,7 @@ def test_the_issues_own_case_no_longer_mints_and_raises_instead(self) -> None: self.assertEqual(before, len(EtherType.__members__)) self.assertNotIn('Xyplex_0x0888', EtherType.__members__) - def test_key_path_minting_is_preserved(self) -> None: + def test_key_path_resolves_without_minting(self) -> None: """``EtherType.get(0x0888)`` -- no ``default`` at all -- falls through ``_missing_``, the one path by which #864 ruled ``get`` may mint. ``Xyplex`` is a real-attributed-name range, and like every other range diff --git a/tests/const/test_const_str_payload_870_unit.py b/tests/const/test_const_str_payload_870_unit.py index 06eaa4a436..c49c14e09b 100644 --- a/tests/const/test_const_str_payload_870_unit.py +++ b/tests/const/test_const_str_payload_870_unit.py @@ -101,7 +101,7 @@ def test_every_one_of_the_40_registered_members_carries_its_value_as_str_payload self.assertEqual(member, member.value) self.assertEqual(len(str(member)), len(member.value)) - def test_registered_and_unregistered_members_are_now_consistent(self) -> None: + def test_registered_and_unregistered_members_both_carry_their_value(self) -> None: """The inconsistency #870 reported: with #869's fix to the unregistered half alone, ``str(Method('frob')) == 'frob'`` while ``str(Method.GET) == ''``. With #870's fix to the registered half, diff --git a/tests/corekit/test_decorators_path_1735_unit.py b/tests/corekit/test_decorators_path_1735_unit.py index 06fba69126..081e20f0ef 100644 --- a/tests/corekit/test_decorators_path_1735_unit.py +++ b/tests/corekit/test_decorators_path_1735_unit.py @@ -46,13 +46,13 @@ class DecoratorsPathTests(unittest.TestCase): def setUp(self) -> None: reimport_once_per_class(self) - def test_the_old_module_path_no_longer_imports(self) -> None: + def test_the_utilities_decorators_path_does_not_import(self) -> None: with self.assertRaises(ModuleNotFoundError) as ctx: importlib.import_module(OLD_PATH) self.assertEqual(ctx.exception.name, OLD_PATH) self.assertIsNone(importlib.util.find_spec(OLD_PATH)) - def test_utilities_no_longer_exports_the_decorators(self) -> None: + def test_utilities_does_not_export_the_decorators(self) -> None: utilities = importlib.import_module('pcapkit.utilities') self.assertFalse(hasattr(utilities, 'decorators')) for name in NAMES: diff --git a/tests/corekit/test_deferred_packet_1516_unit.py b/tests/corekit/test_deferred_packet_1516_unit.py index 7932a03477..1b475423eb 100644 --- a/tests/corekit/test_deferred_packet_1516_unit.py +++ b/tests/corekit/test_deferred_packet_1516_unit.py @@ -210,7 +210,7 @@ def test_every_model_shares_the_one_class_mixin_first(self) -> 'None': self.assertIn('packet', cls.__additional__) self.assertIs(cls.__deferred__, importlib.import_module(deferred_module).Deferred) - def test_the_old_import_paths_are_gone(self) -> 'None': + def test_deferred_packet_has_no_re_export(self) -> 'None': """None of the three paths the name was public at keeps a re-export (GitHub issue #1744; #1715: a moved name keeps no re-export at its old path), so :mod:`pcapkit.corekit.packet` is the one home. diff --git a/tests/corekit/test_enum_get_exception_provenance_923_unit.py b/tests/corekit/test_enum_get_exception_provenance_923_unit.py index 4b399ad40b..c6b9ef5219 100644 --- a/tests/corekit/test_enum_get_exception_provenance_923_unit.py +++ b/tests/corekit/test_enum_get_exception_provenance_923_unit.py @@ -177,7 +177,7 @@ def test_a_value_miss_raises_the_in_library_value_error(self) -> 'None': self.assertNotIsInstance(caught.exception, KeyError) self.assertIn('99', str(caught.exception)) - def test_an_unusable_default_reaches_the_same_two(self) -> 'None': + def test_an_unusable_default_raises_the_same_key_and_value_errors(self) -> 'None': """``default`` naming no registered value falls through to ``key``'s own error, so it must reach the caller as the same class -- and must not name the default, which is the pin GitHub issue #864 added.""" @@ -225,7 +225,7 @@ def test_an_in_library_rejection_is_passed_through_not_rewrapped(self) -> 'None' # Still honours ``default``, as the hook's own docstring promises. self.assertIs(_Ranged.get(99, 1), _Ranged.low) - def test_get_all_reports_the_same_two(self) -> 'None': + def test_get_all_raises_the_same_key_and_value_errors(self) -> 'None': """:meth:`~pcapkit.corekit.enum.EnumLookup.get_all` forwards to ``get``, so its documented ``Raises:`` has to move with it.""" with self.assertRaises(EnumKeyError): @@ -372,7 +372,7 @@ def test_upper_case_still_resolves(self) -> 'None': self.assertIs(TransportProtocol.get('tcp'), TransportProtocol.tcp) self.assertIs(TransportProtocol.get(1), TransportProtocol.tcp) - def test_the_override_no_longer_converts_the_name_miss(self) -> 'None': + def test_the_override_does_not_convert_the_name_miss(self) -> 'None': from pcapkit.const.reg.apptype.apptype import TransportProtocol from pcapkit.utilities.exceptions import EnumKeyError @@ -450,7 +450,7 @@ def test_names_and_values_resolve_as_before(self) -> 'None': self.assertIs(Criticality.get(2), Criticality.notify) self.assertIs(Criticality.get(Criticality.reject), Criticality.reject) - def test_a_name_miss_now_reports_in_the_stdlib_shape(self) -> 'None': + def test_a_name_miss_reports_in_the_stdlib_shape(self) -> 'None': from pcapkit.protocols.application.ngap import Criticality from pcapkit.utilities.exceptions import EnumKeyError @@ -562,7 +562,7 @@ class VendorTemplateParityTests(unittest.TestCase): with it -- the next crawl would simply revert it, which is the trap ``TransportProtocol.get`` living inside an f-string template sets. The same proof shape as ``test_the_tcp_flags_template_renders_the_committed_module`` - and ``test_the_vendor_templates_still_emit_the_fix``: render the template and + and ``test_the_vendor_templates_render_the_committed_modules``: render the template and compare against the committed file. Needs no network -- the crawl supplies only the enumeration block and the ``_missing_`` branches, neither of which the ``get`` region below interpolates, so placeholder arguments render it diff --git a/tests/corekit/test_enum_lookup_reparent_877_unit.py b/tests/corekit/test_enum_lookup_reparent_877_unit.py index 40b75cf44d..911c66cdcb 100644 --- a/tests/corekit/test_enum_lookup_reparent_877_unit.py +++ b/tests/corekit/test_enum_lookup_reparent_877_unit.py @@ -177,7 +177,7 @@ def test_frame_type_flags_itself(self) -> None: self.assertEqual(FrameType.Flags.__bases__, (EnumLookup, enum.IntFlag)) self.assertIn(EnumLookup, FrameType.Flags.__mro__) - def test_all_six_concrete_subclasses_carry_it_transitively(self) -> None: + def test_every_concrete_subclass_carries_it_transitively(self) -> None: from pcapkit.corekit.enum import EnumLookup from pcapkit.protocols.schema.application.httpv2 import (ContinuationFrame, DataFrame, FrameType, HeadersFrame, @@ -269,7 +269,7 @@ class TransportProtocolGetTests(unittest.TestCase): own ``get``, delegating. Every behaviour the override carries is pinned here, not merely that the delegated call runs.""" - def test_get_is_now_a_classmethod(self) -> None: + def test_get_is_a_classmethod(self) -> None: from pcapkit.const.reg.apptype.apptype import TransportProtocol self.assertIsInstance(inspect.getattr_static(TransportProtocol, 'get'), classmethod) diff --git a/tests/corekit/test_enum_lookup_reparent_930_unit.py b/tests/corekit/test_enum_lookup_reparent_930_unit.py index 8f9365e246..5d47096113 100644 --- a/tests/corekit/test_enum_lookup_reparent_930_unit.py +++ b/tests/corekit/test_enum_lookup_reparent_930_unit.py @@ -86,7 +86,7 @@ __all__ = [ 'ReparentedBasesTests', 'GetByNameAndValueTests', 'FailedLookupTests', - 'InheritedQuietnessTests', 'NoMintingTests', 'AllSevenInheritTheBareClassmethodTests', + 'InheritedQuietnessTests', 'NoMintingTests', 'EachInheritsTheBareClassmethodTests', 'NonCanonicalKeyConvergenceTests', 'ZeroRemainOutsideEnumLookupTests', ] @@ -140,7 +140,7 @@ def test_esp_status(self) -> None: def test_fast_binding_acknowledgment_status(self) -> None: """No ``get`` override to pin here (GitHub pull request #940) -- - :class:`AllSevenInheritTheBareClassmethodTests` covers this class + :class:`EachInheritsTheBareClassmethodTests` covers this class alongside the others.""" from aenum import IntEnum @@ -191,7 +191,7 @@ class NoMintingTests(unittest.TestCase): """None of these mints on a miss, exercised through ``get`` itself rather than only through the static counts above.""" - def test_a_battery_of_lookups_does_not_grow_any_of_the_seven(self) -> None: + def test_a_battery_of_lookups_grows_no_registry(self) -> None: """None of these mints on a miss -- each is a closed set on the bare lookup tier, not the mutating :class:`~pcapkit.corekit.enum.EnumRegistry` one. Exercises every @@ -399,7 +399,7 @@ class InheritedQuietnessTests(unittest.TestCase): GitHub issue #933 settled that the two follow house convention and are not loud. - :meth:`test_get_is_now_quiet_on_both_classes` covers ``get`` itself, and + :meth:`test_get_is_quiet_on_both_classes` covers ``get`` itself, and :meth:`test_get_all_is_new_and_quiet_too` covers ``get_all``, which calls this same ``get`` internally -- so a miss reached through ``get_all`` is quiet for the same reason ``get`` itself is. @@ -415,7 +415,7 @@ def tearDown(self) -> None: else: sys.tracebacklimit = self._saved_tracebacklimit - def test_get_is_now_quiet_on_both_classes(self) -> None: + def test_get_is_quiet_on_both_classes(self) -> None: """The behaviour GitHub issue #930 pins: ``get`` is quiet, matching the base, where without the fix it is loud (see the class docstring).""" @@ -486,7 +486,7 @@ def test_get_with_unusable_default_is_quiet_too(self) -> None: self.assertIs(cls.get('NOT_A_REAL_MEMBER', member), member) -class AllSevenInheritTheBareClassmethodTests(unittest.TestCase): +class EachInheritsTheBareClassmethodTests(unittest.TestCase): """Each inherits the base's ``classmethod`` outright, none declaring a ``get`` of its own. @@ -499,7 +499,7 @@ class AllSevenInheritTheBareClassmethodTests(unittest.TestCase): own ``__dict__``. """ - def test_all_seven_inherit_the_bare_classmethod(self) -> None: + def test_each_inherits_the_bare_classmethod(self) -> None: from pcapkit.const.ftp.command import CommandType, ConformanceRequirement from pcapkit.protocols.internet.esp import ESPStatus from pcapkit.protocols.internet.mh import (FastBindingAcknowledgmentStatus, diff --git a/tests/corekit/test_fields_byteorder_1519_unit.py b/tests/corekit/test_fields_byteorder_1519_unit.py index 6af8fc48a1..21159ddc60 100644 --- a/tests/corekit/test_fields_byteorder_1519_unit.py +++ b/tests/corekit/test_fields_byteorder_1519_unit.py @@ -102,7 +102,7 @@ def test_frame_header_reads_the_byte_order_it_is_given(self) -> None: self.assertEqual((header.ts_sec, header.ts_usec), (1, 2)) self.assertEqual(header.pack(dict(packet)), raw) - def test_the_old_import_path_no_longer_imports(self) -> None: + def test_the_schema_misc_byteorder_path_does_not_import(self) -> None: """#1711: the move leaves no re-export at the old path.""" with self.assertRaises(ModuleNotFoundError) as ctx: importlib.import_module(OLD_PATH) diff --git a/tests/corekit/test_fields_copy_dispatch_unit.py b/tests/corekit/test_fields_copy_dispatch_unit.py index d0d8f9822d..4c7acb0032 100644 --- a/tests/corekit/test_fields_copy_dispatch_unit.py +++ b/tests/corekit/test_fields_copy_dispatch_unit.py @@ -88,7 +88,7 @@ def assertCallReachesCopyDunderOnly(self, field: 'FieldBase[Any]') -> None: self.assertIsNot(new_field, field) self.assertIsInstance(new_field, type(field)) - def test_field_base_call_field_py_294(self) -> None: + def test_field_base_call(self) -> None: """:meth:`FieldBase.__call__`, reached via :class:`NoValueField`. :class:`~pcapkit.corekit.fields.misc.NoValueField` is the one concrete @@ -101,19 +101,19 @@ class in this package that never overrides ``__call__``, so it is the self.assertCallReachesCopyDunderOnly(NoValueField()) - def test_field_call_field_py_579(self) -> None: + def test_field_call(self) -> None: """:meth:`Field.__call__`.""" from pcapkit.corekit.fields.field import Field self.assertCallReachesCopyDunderOnly(Field(length=4)) - def test_list_field_call_collections_py_84(self) -> None: + def test_list_field_call(self) -> None: """:meth:`ListField.__call__`.""" from pcapkit.corekit.fields.collections import ListField self.assertCallReachesCopyDunderOnly(ListField(length=4)) - def test_conditional_field_call_misc_py_148(self) -> None: + def test_conditional_field_call(self) -> None: """:meth:`ConditionalField.__call__`.""" from pcapkit.corekit.fields.field import Field from pcapkit.corekit.fields.misc import ConditionalField @@ -121,13 +121,13 @@ def test_conditional_field_call_misc_py_148(self) -> None: field = ConditionalField(field=Field(length=1), condition=lambda packet: True) self.assertCallReachesCopyDunderOnly(field) - def test_payload_field_call_misc_py_299(self) -> None: + def test_payload_field_call(self) -> None: """:meth:`PayloadField.__call__`.""" from pcapkit.corekit.fields.misc import PayloadField self.assertCallReachesCopyDunderOnly(PayloadField(length=4)) - def test_switch_field_call_misc_py_427(self) -> None: + def test_switch_field_call(self) -> None: """:meth:`SwitchField.__call__`.""" from pcapkit.corekit.fields.field import Field from pcapkit.corekit.fields.misc import SwitchField @@ -135,7 +135,7 @@ def test_switch_field_call_misc_py_427(self) -> None: field = SwitchField(selector=lambda packet: Field(length=1)) self.assertCallReachesCopyDunderOnly(field) - def test_schema_field_call_misc_py_650(self) -> None: + def test_schema_field_call(self) -> None: """:meth:`SchemaField.__call__`.""" from pcapkit.corekit.fields.misc import SchemaField from pcapkit.corekit.fields.numbers import UInt8Field @@ -147,7 +147,7 @@ class OneField(Schema): self.assertCallReachesCopyDunderOnly(SchemaField(schema=OneField)) - def test_forward_match_field_call_misc_py_782(self) -> None: + def test_forward_match_field_call(self) -> None: """:meth:`ForwardMatchField.__call__`.""" from pcapkit.corekit.fields.field import Field from pcapkit.corekit.fields.misc import ForwardMatchField diff --git a/tests/corekit/test_fields_misc_packet_context.py b/tests/corekit/test_fields_misc_packet_context.py index cfca15ab6a..d0ca780795 100644 --- a/tests/corekit/test_fields_misc_packet_context.py +++ b/tests/corekit/test_fields_misc_packet_context.py @@ -244,7 +244,7 @@ class CGAParametersRegressionTests(unittest.TestCase): def setUp(self) -> None: reimport_once_per_class(self) - def test_cga_parameters_option_now_parses_end_to_end(self) -> None: + def test_cga_parameters_option_parses_end_to_end(self) -> None: from pcapkit.const.mh.option import Option as Enum_Option from pcapkit.protocols.internet.mh import MH diff --git a/tests/corekit/test_fields_numbers.py b/tests/corekit/test_fields_numbers.py index 31484da6c0..57d0cc33b0 100644 --- a/tests/corekit/test_fields_numbers.py +++ b/tests/corekit/test_fields_numbers.py @@ -116,7 +116,7 @@ def test_a_contradiction_is_judged_by_truth_value(self) -> None: UInt8Field(signed=1) self.assertIs(UInt8Field(signed=0)._signed, False) - def test_the_fixed_classes_still_parse_as_they_always_did(self) -> None: + def test_the_fixed_signedness_classes_parse_with_their_own_sign(self) -> None: """The rejection must not have moved the sign of a default construction.""" from pcapkit.corekit.fields.numbers import Int8Field, UInt8Field diff --git a/tests/corekit/test_fields_numbers_callable_length.py b/tests/corekit/test_fields_numbers_callable_length.py index 4666df33d3..dad14ac798 100644 --- a/tests/corekit/test_fields_numbers_callable_length.py +++ b/tests/corekit/test_fields_numbers_callable_length.py @@ -34,7 +34,7 @@ #: Widths :func:`struct` has a native integer code for, paired with the #: unsigned and signed format characters they build. These are the widths the #: defect hit, and -- established by :meth:`CallableLengthTests -#: .test_every_native_width_was_affected_not_only_the_reported_eight` rather +#: .test_every_native_width_packs_from_a_callable_length` rather #: than assumed -- *all four* were hit, not only the 8 that #591 reproduces. NATIVE_WIDTHS = {1: ('B', 'b'), 2: ('H', 'h'), 4: ('I', 'i'), 8: ('Q', 'q')} @@ -57,7 +57,7 @@ class CallableLengthTests(unittest.TestCase): def setUp(self) -> None: reimport_once_per_class(self) - def test_the_reported_case_a_callable_resolving_to_eight_packs(self) -> None: + def test_a_callable_resolving_to_eight_packs(self) -> None: """``NumberField(length=lambda pkt: 8)`` could not pack at all. The reproduction in #591 verbatim: ``_make_mptcp_dss(DSS, ack=1 << 40)`` @@ -97,7 +97,7 @@ def test_a_callable_length_packs_exactly_as_the_same_static_length_does(self) -> self.assertIs(dynamic._need_process, static._need_process) self.assertEqual(dynamic.pack(value, dict()), static.pack(value, dict())) - def test_every_native_width_was_affected_not_only_the_reported_eight(self) -> None: + def test_every_native_width_packs_from_a_callable_length(self) -> None: """#591 left this open; it is established here rather than assumed. The issue reproduces the 8-octet case only and says explicitly that diff --git a/tests/corekit/test_fields_numbers_negative_length.py b/tests/corekit/test_fields_numbers_negative_length.py index 0237bceedd..f869d81c04 100644 --- a/tests/corekit/test_fields_numbers_negative_length.py +++ b/tests/corekit/test_fields_numbers_negative_length.py @@ -275,7 +275,7 @@ def test_a_positive_bit_length_is_unaffected(self) -> None: self.assertEqual(called.bit_length, 3) self.assertEqual(called._bit_mask, 0b111) - def test_bit_length_zero_still_works_exactly_as_it_does_on_main(self) -> None: + def test_bit_length_zero_constructs_with_a_zero_mask(self) -> None: """The boundary the fix must not break: ``bit_length=0`` is not negative. ``bit_length=0`` constructs and calls cleanly with a mask of ``0``, diff --git a/tests/corekit/test_fields_numbers_unassigned_enum.py b/tests/corekit/test_fields_numbers_unassigned_enum.py index 6458d35660..28163991a6 100644 --- a/tests/corekit/test_fields_numbers_unassigned_enum.py +++ b/tests/corekit/test_fields_numbers_unassigned_enum.py @@ -396,7 +396,7 @@ def _protochains(self, path: str) -> 'list[str]': finally: close_extractor(extractor) - def test_an_unassigned_block_type_no_longer_costs_the_extraction(self) -> None: + def test_an_unassigned_block_type_does_not_cost_the_extraction(self) -> None: """The issue's repro, with a packet block behind the unknown one. Without the fix, ``Extractor`` raises ``ValueError: 28 is diff --git a/tests/corekit/test_fields_numbers_width_repair.py b/tests/corekit/test_fields_numbers_width_repair.py index a9016bfee5..4eab63bb3e 100644 --- a/tests/corekit/test_fields_numbers_width_repair.py +++ b/tests/corekit/test_fields_numbers_width_repair.py @@ -157,7 +157,7 @@ def test_every_octet_boundary_up_to_eight_is_sized_correctly(self) -> None: smallest_past.to_bytes(n + 1, 'big')) self.assertEqual(field._length, n + 1) - def test_the_smallest_mis_sized_value_is_one_not_two_hundred_and_fifty_six(self) -> None: + def test_a_value_under_eight_bits_takes_one_octet(self) -> None: """The issue understates the reach, and this is where it shows. #599 frames the defect as hitting values "just past an octet boundary", @@ -176,7 +176,7 @@ def test_the_smallest_mis_sized_value_is_one_not_two_hundred_and_fifty_six(self) self.assertEqual(field._length, 1, f'{value} needs one octet; floor division sized it at zero') - def test_the_repaired_width_is_the_ceiling_of_the_bit_length_over_eight(self) -> None: + def test_the_width_is_the_ceiling_of_the_bit_length_over_eight(self) -> None: """The invariant the fix establishes, stated as such. Every width the repair picks is ``ceil(bit_length / 8)``. Holding it over @@ -195,7 +195,7 @@ def test_the_repaired_width_is_the_ceiling_of_the_bit_length_over_eight(self) -> self.assertEqual(field.pack(value, dict()), value.to_bytes(expected, 'big')) self.assertEqual(field._length, expected) - def test_a_bit_length_that_is_a_multiple_of_eight_is_untouched_by_the_fix(self) -> None: + def test_a_bit_length_that_is_a_multiple_of_eight_keeps_its_width(self) -> None: """The control, and the reason this survived #591's test suite. Floor division and the ceiling agree exactly when the bit length divides diff --git a/tests/corekit/test_sentinels_housing_unit.py b/tests/corekit/test_sentinels_housing_unit.py index 65372ccc77..307073ccb8 100644 --- a/tests/corekit/test_sentinels_housing_unit.py +++ b/tests/corekit/test_sentinels_housing_unit.py @@ -124,7 +124,7 @@ class NoImportCycleTests(unittest.TestCase): """ - def test_sentinels_module_imports_none_of_its_four_consumers(self) -> 'None': + def test_sentinels_module_imports_none_of_its_consumers(self) -> 'None': """Parse the source's *import statements*, rather than trust that nothing changes them later. @@ -214,7 +214,7 @@ class SentinelsModuleExportRuleTests(unittest.TestCase): """ - def test_all_names_the_three_public_objects_and_no_types(self) -> 'None': + def test_all_names_the_public_objects_and_no_types(self) -> 'None': """``ABSENT`` stays out too: it is private regardless of which module defines it.""" self.assertIn('NULL', sentinels.__all__) diff --git a/tests/foundation/reassembly/data/test_models.py b/tests/foundation/reassembly/data/test_models.py index 954fa96240..1f353adc79 100644 --- a/tests/foundation/reassembly/data/test_models.py +++ b/tests/foundation/reassembly/data/test_models.py @@ -51,7 +51,7 @@ def test_ip_data_models_and_package_aliases(self) -> None: self.assertEqual(storage.ipv6, ()) self.assertEqual(storage.tcp, ()) - def test_completion_is_a_string_that_still_reads_as_the_old_bool(self) -> None: + def test_completion_is_a_string_that_reads_as_a_bool(self) -> None: """The contract ``Datagram.completed`` has to keep as a StrEnum. Deriving from :class:`~pcapkit.utilities.compat.StrEnum` -- as diff --git a/tests/project/test_conda_platform_pin_refresh_1851.py b/tests/project/test_conda_platform_pin_refresh_1851.py index be78c04ab2..a06659cc16 100644 --- a/tests/project/test_conda_platform_pin_refresh_1851.py +++ b/tests/project/test_conda_platform_pin_refresh_1851.py @@ -423,7 +423,7 @@ def test_a_pin_whose_release_lost_every_wheel_warns_for_every_tag(self) -> None: 'on osx-64, and the newest release up to 52.0.0 with wheels for ' 'all of cp311, cp312, cp313, cp314, cp315 there is 48.0.1')]) - def test_a_pin_pypi_no_longer_lists_warns(self) -> None: + def test_a_pin_with_no_stable_pypi_release_warns(self) -> None: # #2028: a pinned release gone from PyPI, or a pre-release, is not one newest_wheel weighs. for version in ('48.5.0', '49.0.0rc1'): with self.subTest(pin=version): diff --git a/tests/project/test_conventions_doc_claims.py b/tests/project/test_conventions_doc_claims.py index ae6802c3ed..24a359a607 100644 --- a/tests/project/test_conventions_doc_claims.py +++ b/tests/project/test_conventions_doc_claims.py @@ -844,7 +844,7 @@ def test_a_delegating_override_is_a_classmethod(self) -> 'None': 'wrong to give it as a delegating override') self.assertIsInstance(vars(OptionType)['get'], staticmethod) self.assertNotIn('super()', inspect.getsource(vars(OptionType)['get'].__func__), - 'OptionType.get now delegates, so the page is wrong to list it ' + 'OptionType.get delegates to super(), so the page is wrong to list it ' 'as the surviving staticmethod') # Execute the outcomes rather than assert the page names them. A grep diff --git a/tests/project/test_ktlo_jobs_gate_nothing_1738.py b/tests/project/test_ktlo_jobs_gate_nothing_1738.py index 30cc789232..53db401cb2 100644 --- a/tests/project/test_ktlo_jobs_gate_nothing_1738.py +++ b/tests/project/test_ktlo_jobs_gate_nothing_1738.py @@ -125,7 +125,7 @@ def test_the_gating_jobs_keep_the_supported_legs(self) -> None: self.assertEqual(sorted(leg['python-version'] for leg in matrix_legs(job_id)), sorted(versions)) -class TestTheCheckNamesAreUnchanged(unittest.TestCase): +class TestEachLegIsNamedForItsVersion(unittest.TestCase): """Each leg is named `` ``, with ``(KTLO)`` after it on a KTLO job.""" def test_each_leg_keeps_its_name(self) -> None: diff --git a/tests/project/test_per_class_import_guard.py b/tests/project/test_per_class_import_guard.py index eadf777301..53a11e113e 100644 --- a/tests/project/test_per_class_import_guard.py +++ b/tests/project/test_per_class_import_guard.py @@ -159,7 +159,7 @@ def test_no_class_purges_the_import_it_keeps(self) -> None: self.assertEqual(unexpected, [], 'drop the whole-package purge, or purge in setUp ' 'instead of calling reimport_once_per_class (GitHub issue #1538)') - def test_every_allowed_class_still_pairs_the_two(self) -> None: + def test_every_allowed_class_is_found_by_the_scan(self) -> None: _, found = scan_tree() self.assertEqual(sorted(key for key in ALLOWED if key not in found), []) diff --git a/tests/project/test_python_matrix_tiers_1633.py b/tests/project/test_python_matrix_tiers_1633.py index 9e2e5a5363..80bb38dba3 100644 --- a/tests/project/test_python_matrix_tiers_1633.py +++ b/tests/project/test_python_matrix_tiers_1633.py @@ -305,7 +305,7 @@ def test_each_ktlo_leg_is_there(self) -> None: found = sorted(leg['python-version'] for leg in legs(name, job_id) if is_ktlo(leg)) self.assertEqual(found, sorted(versions)) - def test_37_to_39_run_where_setup_python_still_builds_them(self) -> None: + def test_each_runner_pinned_version_runs_on_its_pinned_runner(self) -> None: """No Ubuntu 26.04 build of any, which ``ubuntu-latest`` serves.""" for name, job_id, _ in KTLO_LEGS: spec = job(name, job_id) diff --git a/tests/project/test_release_gates.py b/tests/project/test_release_gates.py index c728cd2bdd..8ef673f9a2 100644 --- a/tests/project/test_release_gates.py +++ b/tests/project/test_release_gates.py @@ -3884,18 +3884,18 @@ class TestCondaBumpIsTaggedAndUploaded(CondaWorkflowMixin, unittest.TestCase): #: found. A removal from the real text rather than a hand-written copy of #: that shape, so it cannot drift into testing something the file does not #: say. - PRE_FIX_REMOVAL = '!cancelled() && ' + STATUS_CHECK_PREFIX = '!cancelled() && ' - def _pre_fix_jobs(self) -> 'dict[str, str]': + def _jobs_without_the_status_check(self) -> 'dict[str, str]': """The scan with both publishing jobs' status-check function removed.""" jobs = dict(self.jobs) # type: ignore[arg-type] for name in ('conda-tag', 'conda-dist'): condition = declared_if(jobs[name]) - self.assertIn(self.PRE_FIX_REMOVAL, condition) - mutant = condition.replace(self.PRE_FIX_REMOVAL, '', 1) + self.assertIn(self.STATUS_CHECK_PREFIX, condition) + mutant = condition.replace(self.STATUS_CHECK_PREFIX, '', 1) self.assertFalse( calls_status_check(mutant), - f'removing {self.PRE_FIX_REMOVAL!r} from `{name}` left another ' + f'removing {self.STATUS_CHECK_PREFIX!r} from `{name}` left another ' f'status-check call behind, so this mutation no longer reproduces ' f'#1632: {mutant!r}', ) @@ -4003,7 +4003,7 @@ def test_removing_the_status_check_reproduces_the_defect(self) -> None: stands, rather than quoted from the issue. """ - pre_fix = self._pre_fix_jobs() + pre_fix = self._jobs_without_the_status_check() # #1967: the gate is a job of `head`, and a row reports a call one # of whose jobs ran as `success` (see `head_result`). `skipped` is the # shape #1632 found, a skipped job ahead of the chain. @@ -4932,7 +4932,7 @@ def test_an_ancestor_no_scenario_models_raises(self) -> None: with self.assertRaises(UnsupportedExpression): cascade_skipped_by(self.jobs, 'tag', {'gate': 'success'}) - def test_the_pre_fix_condition_is_what_the_cascade_catches(self) -> None: + def test_the_cascade_stops_tag_whose_own_condition_is_true(self) -> None: """The two halves of #1632, on the fixture: ``tag``'s condition is true and ``tag`` does not run. diff --git a/tests/project/test_unit_tests_push_reports_2030.py b/tests/project/test_unit_tests_push_reports_2030.py index e47a0b4cc1..7c83442cc7 100644 --- a/tests/project/test_unit_tests_push_reports_2030.py +++ b/tests/project/test_unit_tests_push_reports_2030.py @@ -609,7 +609,7 @@ def test_the_by_design_matching(self) -> None: self.assertEqual(found.status, 'warning') self.assertEqual(found.warned, [f'`{job}`: `{title}`']) - def test_with_nothing_listed_the_old_install_failures_warn(self) -> None: + def test_with_nothing_listed_an_install_failure_warns(self) -> None: """Run 39718608950's pypy3.10 install failure warns: nothing lists it as by design (#2040).""" outputs, report, _ = self.report('success', check_runs(PYPY, GREEN)) self.assertEqual(outputs['status'], 'warning') diff --git a/tests/protocols/application/test_http_guess_http2_1141_unit.py b/tests/protocols/application/test_http_guess_http2_1141_unit.py index 0bf558e820..1d7add3b83 100644 --- a/tests/protocols/application/test_http_guess_http2_1141_unit.py +++ b/tests/protocols/application/test_http_guess_http2_1141_unit.py @@ -75,7 +75,7 @@ #: frames of unknown type. FUZZ_SEED = 1141 FUZZ_COUNT = 5000 -PRE_FIX_HTTP2_LABELS = 566 +UNCHECKED_GUESS_HTTP2_LABELS = 566 def _fuzz_buffers() -> 'list[bytes]': @@ -158,7 +158,7 @@ def test_seeded_fuzz_false_positive_rate_drops(self) -> None: if http.version == '2': # type: ignore[attr-defined] labels.append(data) - self.assertLess(len(labels), PRE_FIX_HTTP2_LABELS // 4) + self.assertLess(len(labels), UNCHECKED_GUESS_HTTP2_LABELS // 4) for data in labels: with self.subTest(frame=data[:9].hex()): self.assertEqual(data[3], 0x0) diff --git a/tests/protocols/application/test_http_unit.py b/tests/protocols/application/test_http_unit.py index f333e62b7b..1bd3709b83 100644 --- a/tests/protocols/application/test_http_unit.py +++ b/tests/protocols/application/test_http_unit.py @@ -1412,7 +1412,7 @@ def test_guess_version_does_not_suppress_struct_error_on_the_http1_arm(self) -> schema modules that share the pattern. See ``test_guess_version_reports_unknown_version_for_a_short_payload`` for the outer-header case, and - ``test_guess_version_no_longer_leaks_a_bare_struct_error_for_an_inner_field_shortfall`` + ``test_guess_version_does_not_leak_a_bare_struct_error_for_an_inner_field_shortfall`` below for the inner one. It is also unnecessary: nothing reaches a :exc:`struct.error` through @@ -1453,7 +1453,7 @@ def test_guess_version_does_not_suppress_struct_error_on_the_http1_arm(self) -> with self.assertRaises(struct.error): HTTP(io.BytesIO(raw), len(raw)) - def test_guess_version_no_longer_leaks_a_bare_struct_error_for_an_inner_field_shortfall(self) -> None: + def test_guess_version_does_not_leak_a_bare_struct_error_for_an_inner_field_shortfall(self) -> None: """A buffer that clears nine octets must not crash one field further in. #799's ``httpv2.HTTP.unpack`` guard only protects the fixed nine-octet @@ -1577,7 +1577,7 @@ def test_httpv1_id_make_data_and_request_construction(self) -> None: with self.assertRaises(ProtocolError): proto._read_http_header(b'BAD nope nope\r\nHost: example') - def test_method_get_is_now_case_sensitive(self) -> None: + def test_method_get_is_case_sensitive(self) -> None: """``Method.get`` must not resolve a mixed-case method to the registered member of another casing -- GitHub issue #896. diff --git a/tests/protocols/application/test_httpv2_frame_length_1121_unit.py b/tests/protocols/application/test_httpv2_frame_length_1121_unit.py index 6be495f8f9..d76a8331d2 100644 --- a/tests/protocols/application/test_httpv2_frame_length_1121_unit.py +++ b/tests/protocols/application/test_httpv2_frame_length_1121_unit.py @@ -93,7 +93,7 @@ def test_parsed_frames_rebuild_to_the_same_octets(self) -> None: info = HTTPv2(io.BytesIO(raw), len(raw)).info self.assertEqual(bytes(HTTPv2(type=info.type, sid=info.sid, frame=info)), raw) - def test_the_old_header_inclusive_length_is_rejected(self) -> None: + def test_a_header_inclusive_length_is_rejected(self) -> None: """A fixed-size frame declaring payload + 9 is a size error.""" from pcapkit.protocols.application.httpv2 import HTTP as HTTPv2 from pcapkit.utilities.exceptions import ProtocolError diff --git a/tests/protocols/application/test_layer_placement_unit.py b/tests/protocols/application/test_layer_placement_unit.py index 0c56abd5b4..1781c495a9 100644 --- a/tests/protocols/application/test_layer_placement_unit.py +++ b/tests/protocols/application/test_layer_placement_unit.py @@ -307,7 +307,7 @@ def test_layer_link_extraction_of_a_headerless_ipv4_capture(self) -> None: self.assertEqual(ospf.layer, 'Application') self.assertFalse(ospf._sigterm, "'link' must no longer terminate at OSPF") - def test_layer_application_extraction_now_terminates_at_ospf(self) -> None: + def test_layer_application_extraction_terminates_at_ospf(self) -> None: """The flip side: ``layer='application'`` matches at OSPF.""" frame = self.extract_ipv4_ospf(layer='application') self.assertEqual(str(frame.protochain), 'IPv4:OSPFv2:Raw') diff --git a/tests/protocols/internet/test_hip_locator_set_length_unit.py b/tests/protocols/internet/test_hip_locator_set_length_unit.py index 39c58f7d52..b3ce87580b 100644 --- a/tests/protocols/internet/test_hip_locator_set_length_unit.py +++ b/tests/protocols/internet/test_hip_locator_set_length_unit.py @@ -195,7 +195,7 @@ def test_every_shape_packs_the_rfc_total(self) -> None: self.assertEqual(len(raw), 4 + contents + (len(raw) - 4 - contents)) self.assertEqual(raw[2:4], contents.to_bytes(2, 'big')) - def test_the_three_plain_shapes_keep_the_octet_counts_main_emitted(self) -> None: + def test_the_plain_shapes_pack_their_rfc_octet_counts(self) -> None: """n = 1, 2, 5 pack 32, 56 and 128 octets. These are the shapes where the two defects cancel exactly, and the diff --git a/tests/protocols/internet/test_hip_unit.py b/tests/protocols/internet/test_hip_unit.py index 5cf24e78ec..8e95ce08b7 100644 --- a/tests/protocols/internet/test_hip_unit.py +++ b/tests/protocols/internet/test_hip_unit.py @@ -3182,7 +3182,7 @@ def pre_651_total(length: int) -> int: # own ``Length`` rather than off ``pkt['len']``, which its nested # locators shadow while they pack. The identity of that one callback is # asserted directly in - # :meth:`test_hip_padding_sites_are_the_two_known_callbacks_and_nothing_else`, + # :meth:`test_hip_padding_sites_are_the_known_callbacks_and_nothing_else`, # so a third expression cannot appear unnoticed. # # The sweep above covers all eight residues, which is enough for any @@ -3219,7 +3219,7 @@ def pre_651_total(length: int) -> int: with self.assertRaisesRegex(FieldValueError, 'invalid parameter length'): hip_schema.parameter_padding_len({'len': -1}) - def test_hip_padding_sites_are_the_two_known_callbacks_and_nothing_else(self) -> None: + def test_hip_padding_sites_are_the_known_callbacks_and_nothing_else(self) -> None: """#651/#664/#679: two padding callbacks cover every parameter, and no third exists. Every HIP padding site goes through diff --git a/tests/protocols/internet/test_ipv4_ts_sec_roundtrip_unit.py b/tests/protocols/internet/test_ipv4_ts_sec_roundtrip_unit.py index bb0b66305d..1a1df41507 100644 --- a/tests/protocols/internet/test_ipv4_ts_sec_roundtrip_unit.py +++ b/tests/protocols/internet/test_ipv4_ts_sec_roundtrip_unit.py @@ -115,7 +115,7 @@ def test_termination_indicators_are_data(self) -> None: option = self.option(header('820301'), 'SEC') self.assertEqual(option.termination, ()) # type: ignore[attr-defined] - def test_indicators_that_no_longer_cover_the_octets_are_positional(self) -> None: + def test_indicators_that_do_not_cover_the_octets_are_positional(self) -> None: from pcapkit.const.ipv4.classification_level import ClassificationLevel from pcapkit.const.ipv4.option_number import OptionNumber from pcapkit.const.ipv4.protection_authority import ProtectionAuthority diff --git a/tests/protocols/internet/test_ipv6_ext_unit.py b/tests/protocols/internet/test_ipv6_ext_unit.py index 5795ee8336..d1af7db59a 100644 --- a/tests/protocols/internet/test_ipv6_ext_unit.py +++ b/tests/protocols/internet/test_ipv6_ext_unit.py @@ -473,7 +473,7 @@ def _constant(klass: type, member: str) -> 'str | None': except Exception: # pylint: disable=broad-exception-caught return None - def test_the_family_is_exactly_the_eight_known_members(self) -> None: + def test_the_family_is_exactly_the_known_members(self) -> None: """Importing :mod:`pcapkit.protocols.internet` must turn up exactly :attr:`KNOWN_MEMBERS`. This is what keeps the per-subclass tests below from passing vacuously on a walk that discovered nothing. @@ -639,7 +639,7 @@ def test_ah_and_esp_double_inherit_and_linearise(self) -> None: self.assertTrue(issubclass(klass, IPv6_Ext)) self.assertTrue(issubclass(klass, Internet)) - def test_esp_extension_mode_is_no_longer_dead(self) -> None: + def test_esp_extension_mode_guards_payload_protocol_and_protochain(self) -> None: """GitHub issue #895: ``ESP`` accepted ``extension=``, stored it in ``_extf`` and never read it. Subclassing the base makes ``_extf`` load-bearing for @@ -765,7 +765,7 @@ def test_length_hint_is_the_eight_octet_rfc_6564_minimum(self) -> None: self.assertEqual(object.__new__(IPv6_Ext).__length_hint__(), 8) - def test_next_is_now_shared_by_every_subclass(self) -> None: + def test_next_is_shared_by_every_subclass(self) -> None: """Every subclass inherits the base's ``next`` property (#917) -- without it, reading one raises :exc:`AttributeError` -- which is sound because :rfc:`8200#section-4.1` puts a Next Header octet first in every diff --git a/tests/protocols/internet/test_ipv6_option_helpers_1519_unit.py b/tests/protocols/internet/test_ipv6_option_helpers_1519_unit.py index 8f7e3110b3..e89ba62d43 100644 --- a/tests/protocols/internet/test_ipv6_option_helpers_1519_unit.py +++ b/tests/protocols/internet/test_ipv6_option_helpers_1519_unit.py @@ -80,7 +80,7 @@ def _shared(self) -> 'object': def _headers(self) -> 'list[tuple[object, str]]': return [(importlib.import_module(name), prefix) for name, prefix in HEADERS] - def test_shared_module_holds_all_nine_helpers(self) -> None: + def test_shared_module_holds_every_helper(self) -> None: shared = self._shared() self.assertEqual(sorted(shared.__all__), sorted([*BOUND, 'quick_start_data_selector', *UNBOUND])) diff --git a/tests/protocols/internet/test_mh_unit.py b/tests/protocols/internet/test_mh_unit.py index bfddc26af8..d6ea73ced2 100644 --- a/tests/protocols/internet/test_mh_unit.py +++ b/tests/protocols/internet/test_mh_unit.py @@ -1435,7 +1435,7 @@ def test_mh_fmipv6_round_trip_is_byte_identical(self) -> None: chksum=parsed.chksum, data=parsed)) self.assertEqual(rebuilt, raw) - with self.subTest('FBack, unassigned status now raises on construction'): + with self.subTest('FBack, unassigned status raises on construction'): # A status value RFC 5568 leaves unassigned is not one of the # ``cases`` above. Constructing from ``data=`` builds the wire bytes # and then reads them straight back to populate ``.info`` -- that @@ -1569,7 +1569,7 @@ def handover_initiate(code: int) -> object: with self.assertRaises(EnumValueError): enum_cls(value) - with self.subTest('get() backports string and integer lookups, and no longer mints'): + with self.subTest('get() resolves string and integer lookups without minting'): # An unknown *name* is ``EnumKeyError`` (GitHub issue #923), not # ``EnumValueError``, so a name miss and a value miss do not report # identically: stdlib ``E['nosuch']`` raises ``KeyError``, so the @@ -1656,7 +1656,7 @@ def test_mh_get_default_works_uniformly_through_the_inherited_method(self) -> No classes = (FastBindingAcknowledgmentStatus, IPv6AddressPrefixCode, LMAAddressCode, LocalizedRoutingStatus) - with self.subTest('a default argument no longer raises TypeError'): + with self.subTest('a default argument does not raise TypeError'): # This is exactly the call GitHub issue #935 reports as failing: # a second positional argument to a ``@staticmethod`` that declares # only one. @@ -1697,7 +1697,7 @@ def test_mh_get_default_works_uniformly_through_the_inherited_method(self) -> No with self.assertRaises(EnumValueError): cls.get(9999, 99999) - with self.subTest('omitting default still raises EnumKeyError, exactly as before'): + with self.subTest('omitting default raises EnumKeyError'): for cls in classes: with self.subTest(cls=cls.__name__): with self.assertRaises(EnumKeyError): @@ -1731,7 +1731,7 @@ def test_mh_local_enums_raise_and_do_not_alias(self) -> None: from pcapkit.protocols.misc.raw import Raw from pcapkit.utilities.exceptions import EnumValueError - with self.subTest('LocalizedRoutingStatus and LMAAddressCode raise and now have get()'): + with self.subTest('LocalizedRoutingStatus and LMAAddressCode raise and have get()'): # Neither carries a hand-rolled ``get()`` (GitHub issue #880); both # inherit ``get``/``get_all`` from # :class:`~pcapkit.corekit.enum.EnumLookup` (GitHub issue #930), as @@ -1825,7 +1825,7 @@ def wrap_in_ipv4(mh_payload: bytes) -> IPv4: self.assertIsInstance(ip.payload, Raw) self.assertEqual(bytes(ip.payload), bytes(lra_raw)) - with self.subTest('over IPv6, the raise now costs only the MH slot (GitHub issue #891)'): + with self.subTest('over IPv6, the raise costs only the MH slot (GitHub issue #891)'): # Mobility Header is *also* one of IPv6's own chained extension # headers (``Enum_ExtensionHeader.Mobility_Header``, value 135, in # ``pcapkit/const/ipv6/extension_header.py``), so IPv6 never @@ -2055,7 +2055,7 @@ def test_mh_constructed_header_round_trips(self) -> None: self.assertEqual(bytes(MH(next=parsed.next, type=parsed.type, chksum=parsed.chksum, data=parsed)), raw) - def test_mh_opaque_message_body_cannot_be_padded(self) -> None: + def test_mh_opaque_message_body_is_padded_with_a_warning(self) -> None: """An opaque message body is padded to alignment, with a warning. A message whose body is raw bytes carries no mobility options, so the @@ -2448,7 +2448,7 @@ def test_mh_pmipv6_options_round_trip_byte_for_byte(self) -> None: Note: :attr:`~pcapkit.const.mh.option.Option.CGA_Parameters` is absent, deliberately: it parses (see - :meth:`test_mh_cga_parameters_option_now_parses`), but this test's + :meth:`test_mh_cga_parameters_option_parses`), but this test's stricter round-trip identity is not verified for it -- a separate, deliberate scope decision, not implied by parsing alone. """ @@ -3553,7 +3553,7 @@ def test_mh_nested_suboptions_build_from_raw_kwargs(self) -> None: {'vendor': 32473, 'subtype': 3, 'data': payload})]) self.assertIn(payload, option.pack()) - def test_mh_cga_parameters_option_now_parses(self) -> None: + def test_mh_cga_parameters_option_parses(self) -> None: """The CGA Parameters option parses end to end. This guards against a :exc:`KeyError` on the exact reproduction below: @@ -3567,7 +3567,7 @@ def test_mh_cga_parameters_option_now_parses(self) -> None: :class:`~pcapkit.corekit.fields.misc.ForwardMatchField` miscounted into the nested schema's length (#446/#456). See also :meth:`tests.corekit.test_fields_misc_packet_context. - CGAParametersRegressionTests.test_cga_parameters_option_now_parses_end_to_end` + CGAParametersRegressionTests.test_cga_parameters_option_parses_end_to_end` for the same reproduction asserting the parsed fields. """ from pcapkit.const.mh.option import Option diff --git a/tests/protocols/link/test_l2tp_version_unit.py b/tests/protocols/link/test_l2tp_version_unit.py index bda014c31e..04dd3694d2 100644 --- a/tests/protocols/link/test_l2tp_version_unit.py +++ b/tests/protocols/link/test_l2tp_version_unit.py @@ -234,7 +234,7 @@ def test_l2tpv3_over_ip_degrades_to_raw_rather_than_a_fabricated_header(self) -> self.assertEqual(ipv4_info['raw']['packet'], payload) self.assertIn('invalid version', ipv4_info['raw']['error']) - def test_l2tpv3_over_udp_1701_no_longer_parses_as_l2tpv2(self) -> None: + def test_l2tpv3_over_udp_1701_does_not_parse_as_l2tpv2(self) -> None: """:rfc:`3931` ยง4.1.2 puts L2TPv3 on port 1701 too, and that is a live capture. This is the case that guards a real dissection rather than a diff --git a/tests/protocols/misc/test_pcapng_unit.py b/tests/protocols/misc/test_pcapng_unit.py index 65b0e36f77..79e0791385 100644 --- a/tests/protocols/misc/test_pcapng_unit.py +++ b/tests/protocols/misc/test_pcapng_unit.py @@ -4051,7 +4051,7 @@ def test_almost_every_truncation_level_parses(self) -> None: self.assertGreater(len(frames), 0.98 * (len(self.whole) + 1)) self.assertLess(len(failures), 16) - def test_every_level_that_still_fails_fails_for_a_reason_of_its_own(self) -> None: + def test_every_failing_cut_fails_for_a_reason_of_its_own(self) -> None: """The handful left are all cuts that reach the section header itself. None of them costs a frame that was in the file: a cut that deep has diff --git a/tests/protocols/schema/test_schema_field_remainder_unit.py b/tests/protocols/schema/test_schema_field_remainder_unit.py index 4283c07ce5..d0cdebdaf9 100644 --- a/tests/protocols/schema/test_schema_field_remainder_unit.py +++ b/tests/protocols/schema/test_schema_field_remainder_unit.py @@ -151,7 +151,7 @@ def test_remainder_is_not_a_field(self) -> None: with self.assertRaises(KeyError): inner['__remainder__'] # pylint: disable=pointless-statement,unsubscriptable-object - def test_remainder_that_no_longer_fits_is_dropped(self) -> None: + def test_remainder_that_does_not_fit_is_dropped(self) -> None: _, outer = _nested_schemas() data = outer.unpack(RAW, len(RAW), None).to_dict() diff --git a/tests/protocols/schema/test_schema_metaclass_abc_cache_unit.py b/tests/protocols/schema/test_schema_metaclass_abc_cache_unit.py index 854311d634..64595c18b4 100644 --- a/tests/protocols/schema/test_schema_metaclass_abc_cache_unit.py +++ b/tests/protocols/schema/test_schema_metaclass_abc_cache_unit.py @@ -249,7 +249,7 @@ class _DictSubclass(dict): self.assertFalse(isinstance(ChainMap(), _SharedChild)) self.assertFalse(isinstance(ChainMap(), _Shared)) - def test_the_pcapng_1248_symptom_no_longer_reproduces(self) -> None: + def test_an_end_record_is_not_an_ipv4_or_ipv6_record(self) -> None: """The user-facing payoff: a real ``isinstance`` call site, not a probe. :meth:`NameResolutionBlock.post_process diff --git a/tests/protocols/test_construction_keyword_check_unit.py b/tests/protocols/test_construction_keyword_check_unit.py index 11df0900fa..46dd086928 100644 --- a/tests/protocols/test_construction_keyword_check_unit.py +++ b/tests/protocols/test_construction_keyword_check_unit.py @@ -25,7 +25,7 @@ :exc:`~pcapkit.utilities.warnings.UnknownFieldWarning` for a field it does not know (:file:`pcapkit/protocols/schema/schema.py`). The asymmetry between the two is what #617 is about, and -:meth:`AsymmetryTests.test_the_schema_layer_still_warns_where_construction_now_raises` +:meth:`AsymmetryTests.test_the_schema_layer_warns_where_construction_raises` pins both halves of it in one place. What is checked, and what is deliberately not @@ -183,7 +183,7 @@ def __index__(cls) -> 'int': # type: ignore[override] class RejectionTests(unittest.TestCase): """An undeclared construction keyword raises rather than vanishing.""" - def test_the_three_misspellings_of_the_defect_are_each_refused(self) -> None: + def test_each_tcp_base_misspelling_is_refused(self) -> None: """Each key of #602, put back one at a time, raises and is named. ``TCP_BASE`` is correct, so reproducing the report means @@ -636,7 +636,7 @@ def _make_data(cls, data: 'Any') -> 'dict[str, Any]': class AsymmetryTests(unittest.TestCase): """The two layers, and what each does with a name it does not know.""" - def test_the_schema_layer_still_warns_where_construction_now_raises(self) -> None: + def test_the_schema_layer_warns_where_construction_raises(self) -> None: """One unknown name, two layers, both of them audible. This is the asymmetry #617 reported, asserted from both ends so that it diff --git a/tests/protocols/test_option_generator_tcp_base_unit.py b/tests/protocols/test_option_generator_tcp_base_unit.py index ab6281f90c..85fdc60a08 100644 --- a/tests/protocols/test_option_generator_tcp_base_unit.py +++ b/tests/protocols/test_option_generator_tcp_base_unit.py @@ -29,7 +29,7 @@ declares. ``TCP.make`` still ends in ``**kwargs`` and still reads nothing out of it -- the check is upstream of it -- so the account above remains the account of how the defect was possible, and -:meth:`TCPBaseKeywordTests.test_an_undeclared_keyword_is_now_refused_rather_than_absorbed` +:meth:`TCPBaseKeywordTests.test_an_undeclared_keyword_is_refused_rather_than_absorbed` is where the refusal is pinned. Why the expected header is written out here @@ -244,7 +244,7 @@ def test_tcp_base_is_the_expected_header(self) -> None: options = _load_generator() self.assertEqual(dict(options.TCP_BASE), EXPECTED_HEADER) - def test_an_undeclared_keyword_is_now_refused_rather_than_absorbed(self) -> None: + def test_an_undeclared_keyword_is_refused_rather_than_absorbed(self) -> None: """Constructing with an undeclared keyword raises. ``make`` ends its signature with ``**kwargs`` and reads nothing out of it, @@ -282,7 +282,7 @@ def test_an_undeclared_keyword_is_now_refused_rather_than_absorbed(self) -> None # silence here is the silence of an exception having been raised. self.assertEqual([str(warning.message) for warning in caught], []) - def test_the_three_keys_of_the_defect_are_each_refused(self) -> None: + def test_each_tcp_base_misspelling_is_refused(self) -> None: """Each misspelling of #602 raises, named, rather than being dropped. ``TCP_BASE`` is correct, so the mapping itself cannot diff --git a/tests/protocols/transport/test_tcp_mptcp_length_unit.py b/tests/protocols/transport/test_tcp_mptcp_length_unit.py index c164a29ee3..a1aaa1b94e 100644 --- a/tests/protocols/transport/test_tcp_mptcp_length_unit.py +++ b/tests/protocols/transport/test_tcp_mptcp_length_unit.py @@ -106,7 +106,7 @@ def test_mp_capable_header_decodes_its_length_as_twelve(self) -> 'None': self.assertEqual(header['length'], len(MP_CAPABLE_OPTION)) self.assertNotEqual(header['length'], 60) - def test_subtype_still_decodes_beside_the_corrected_length(self) -> 'None': + def test_subtype_decodes_from_the_same_window_as_length(self) -> 'None': """``subtype`` reads MP_CAPABLE, from the same window as ``length``. This is the entry that pins the window's origin, so it is asserted diff --git a/tests/protocols/transport/test_tcp_roundtrip_unit.py b/tests/protocols/transport/test_tcp_roundtrip_unit.py index ab01bb0526..9987902e51 100644 --- a/tests/protocols/transport/test_tcp_roundtrip_unit.py +++ b/tests/protocols/transport/test_tcp_roundtrip_unit.py @@ -211,7 +211,7 @@ def test_make_honours_an_explicit_granularity(self) -> None: large = proto._make_mode_timeout(code, timeout=40000, granularity=False) self.assertEqual(large.pack().hex(), '1c04829a') - def test_edited_user_timeout_switches_unit_when_it_no_longer_fits(self) -> None: + def test_edited_user_timeout_switches_unit_when_it_does_not_fit(self) -> None: from pcapkit.protocols.data.transport.tcp import UserTimeout from pcapkit.protocols.transport.tcp import TCP from pcapkit.utilities.exceptions import ProtocolError diff --git a/tests/test_tier_guard.py b/tests/test_tier_guard.py index 63de1d8024..d8b4905977 100644 --- a/tests/test_tier_guard.py +++ b/tests/test_tier_guard.py @@ -1876,7 +1876,7 @@ def test_job_sections_agrees_with_the_single_job_slice(self) -> None: with self.subTest(job=name): self.assertEqual(section, job_section(text, name)) - def test_each_job_selection_is_one_of_the_three_recognised_shapes(self) -> None: + def test_each_job_selection_is_a_recognised_shape(self) -> None: """A new shape has to fail here rather than be guessed at. These are recognised: subtract ``--ignore`` flags from the whole suite @@ -2116,7 +2116,7 @@ def test_every_gate_a_job_reaches_has_its_dependency_installed(self) -> None: unexplained, [], '\n\n'.join(_dependency_gates.describe_gap(gap) for gap in unexplained)) - def test_the_four_gates_737_and_740_fixed_are_covered_on_every_job_reaching_them(self) -> None: + def test_the_dpkt_crypto_emoji_and_pycrate_gates_are_covered_on_every_job_reaching_them(self) -> None: """What this guard exists to stop regressing, named one flag at a time. #737 added ``DPKT`` and #740 added ``crypto``, ``cli`` and ``NGAP`` to diff --git a/tests/toolkit/test_pyshark_unit.py b/tests/toolkit/test_pyshark_unit.py index 524d42f248..4d193bc55f 100644 --- a/tests/toolkit/test_pyshark_unit.py +++ b/tests/toolkit/test_pyshark_unit.py @@ -367,7 +367,7 @@ def test_tcp_traceflow_raises_for_a_non_numeric_encap_type(self) -> None: toolkit.tcp_traceflow(packet) self.assertEqual(ctx.exception.args[0], 'frame.encap_type=Ethernet') - def test_filter_name_fallback_no_longer_upper_cases_onto_a_member(self) -> None: + def test_an_ambiguous_filter_name_raises_rather_than_upper_casing_onto_a_member(self) -> None: """A fallback trying ``Enum_LinkType.get(name.upper())`` (#843) silently answers ``PPP`` (9) for a ``ppp-with-direction`` capture (DLT 204) and ``LAPD`` (203) for a ``linux-lapd`` one (DLT 177). diff --git a/tests/utilities/test_config_unit.py b/tests/utilities/test_config_unit.py index 6e8fc42425..521e5d3a97 100644 --- a/tests/utilities/test_config_unit.py +++ b/tests/utilities/test_config_unit.py @@ -293,7 +293,7 @@ def test_config_imports_only_warnings(self) -> None: def test_logging_does_not_import_config(self) -> None: self.assertNotIn('pcapkit.utilities.config', self.imports(PACKAGE / 'utilities' / 'logging.py')) - def test_the_old_paths_are_gone(self) -> None: + def test_a_moved_name_has_no_re_export(self) -> None: for module, names in MOVED.items(): loaded = importlib.import_module(module) for name in names: diff --git a/tests/utilities/test_exceptions_excepthook.py b/tests/utilities/test_exceptions_excepthook.py index 76fa311213..fd07b7d41d 100644 --- a/tests/utilities/test_exceptions_excepthook.py +++ b/tests/utilities/test_exceptions_excepthook.py @@ -292,7 +292,7 @@ class ChainedExceptionTests(unittest.TestCase): """ - def test_an_explicit_from_chain_matches_the_old_shape(self) -> None: + def test_an_explicit_from_chain_matches_the_tracebacklimit_zero_shape(self) -> None: code = ''' import contextlib import io @@ -341,7 +341,7 @@ def new_mechanism_output(): self.assertEqual(proc.returncode, 0, proc.stderr) self.assertEqual(proc.stdout.strip(), 'MATCH', proc.stdout) - def test_an_implicit_context_chain_matches_the_old_shape(self) -> None: + def test_an_implicit_context_chain_matches_the_tracebacklimit_zero_shape(self) -> None: code = ''' import contextlib import io @@ -546,7 +546,7 @@ class ThreadingExcepthookTests(unittest.TestCase): """ - def test_a_loud_base_error_on_a_thread_matches_the_old_two_line_shape(self) -> None: + def test_a_loud_base_error_on_a_thread_matches_the_tracebacklimit_zero_shape(self) -> None: code = ''' import io import sys @@ -598,7 +598,7 @@ def boom(): self.assertEqual(proc.returncode, 0, proc.stderr) self.assertEqual(proc.stdout.strip(), 'MATCH', proc.stdout) - def test_a_chained_error_on_a_thread_also_matches_the_old_shape(self) -> None: + def test_a_chained_error_on_a_thread_also_matches_the_tracebacklimit_zero_shape(self) -> None: code = ''' import io import sys diff --git a/tests/vendor/test_crawler_reachability_unit.py b/tests/vendor/test_crawler_reachability_unit.py index efd3ca8e4f..d5ab1d192d 100644 --- a/tests/vendor/test_crawler_reachability_unit.py +++ b/tests/vendor/test_crawler_reachability_unit.py @@ -218,7 +218,7 @@ def test_every_crawler_is_reachable_from_its_own_protocol_target(self) -> None: f'`pcapkit-vendor --target ` either, because they are absent ' f'from their own subpackage\'s __all__') - def test_the_two_target_lists_agree(self) -> None: + def test_the_root_target_list_agrees_with_its_subpackages(self) -> None: # pcapkit/vendor/__init__.py re-lists what its subpackages list, by hand, # so the root and the union of the parts are two copies of one fact and # are allowed to disagree without anything noticing. The duplicate was diff --git a/tests/vendor/test_vendor_ipv6_extension_header_925_unit.py b/tests/vendor/test_vendor_ipv6_extension_header_925_unit.py index ae160a8f8b..533284e0dd 100644 --- a/tests/vendor/test_vendor_ipv6_extension_header_925_unit.py +++ b/tests/vendor/test_vendor_ipv6_extension_header_925_unit.py @@ -128,7 +128,7 @@ #: Protocol Numbers registry cites an author's name, or an extra RFC 4727 #: citation), which is a known, reported divergence rather than a parsing #: defect -- see this suite's -#: ``test_five_comments_genuinely_diverge_from_the_historical_registry``. The +#: ``test_the_divergent_comments_differ_from_the_historical_registry``. The #: committed const file carries the authoritative registry's text for every #: member, which is what #: ``test_context_matches_the_committed_const_file_byte_for_byte`` pins. @@ -260,14 +260,14 @@ def test_keyword_style_names_are_not_derived_from_the_verbose_description(self) self.assertNotEqual(naive, 'IPv6_Route') self.assertEqual(naive, 'Routing_Header_for_IPv6') - def test_six_comments_are_unchanged_from_the_historical_registry(self) -> None: + def test_the_shared_comments_match_the_historical_registry(self) -> None: vendor, lines = self._vendor() enum, _ = vendor.process(lines) for name, expected_comment in UNCHANGED_COMMENTS.items(): with self.subTest(name=name): self.assertEqual(_comment_from_enum(enum, name), expected_comment) - def test_five_comments_genuinely_diverge_from_the_historical_registry(self) -> None: + def test_the_divergent_comments_differ_from_the_historical_registry(self) -> None: # Documents the divergence rather than hiding it: these five members' # *comments* differ from the committed const file because the two # registries carry different Reference/Description text for the same diff --git a/tests/vendor/test_vendor_missing_body_unit.py b/tests/vendor/test_vendor_missing_body_unit.py index a415a6e06e..4c5ead5346 100644 --- a/tests/vendor/test_vendor_missing_body_unit.py +++ b/tests/vendor/test_vendor_missing_body_unit.py @@ -179,7 +179,7 @@ def test_no_crawler_emits_a_self_recursive_lookup(self) -> None: f'``_missing_``, which re-enters ``_missing_`` ' f'for the same value; see GitHub issue #866') - def test_the_two_regressed_crawlers_emit_a_single_returning_line(self) -> None: + def test_the_record_and_secrets_type_crawlers_emit_a_single_returning_line(self) -> None: """The specific pair from #866, pinned by name. Kept alongside the general sweeps because these are the crawlers #866