Skip to content

Fix ALPN empty-string normalization mismatch in tests.test_security_compat_utils #21

@MichaelDecent

Description

@MichaelDecent

Summary

tests.test_security_compat_utils has a failing ALPN normalization assertion in test_alpn_and_policy.

Reproduction

uv run python -m unittest -v tests.test_security_compat_utils

Current result

  • Ran: 3 tests
  • Failures: 1
  • Failing test:
    • test_alpn_and_policy

Failure details

At:

  • tests/test_security_compat_utils.py:17

Assertion:

self.assertIsNone(normalize_alpn(''))

Observed:

  • normalize_alpn('') returns ''
  • failure: AssertionError: '' is not None

Expected behavior

Clarify and align either:

  1. implementation: empty ALPN normalizes to None, or
  2. test expectation: empty ALPN normalizes to empty string.

Acceptance criteria

  • Behavior contract for empty ALPN input is explicit.
  • uv run python -m unittest -v tests.test_security_compat_utils passes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions