Option C Tools
Loading...
Searching...
No Matches
tests_tools.test_entropy_detection Namespace Reference

Classes

class  TestShannonEntropy
class  TestCheckEntropyViolations
class  TestEntropyIntegration
class  TestDocstringThresholds
class  TestFieldNameExclusions
class  TestExclusionValidation
class  TestWaiverModule

Variables

str _B64_TEST_STR = "aB3dE7fG9hJ2kL5mN8pQ1rS4tU6vW0xY"
str _MID_ENTROPY_STR = "abcdefghijklmnopqrstuvwxyz01"
str _HIGH_ENTROPY_STR = "abcdefghijklmnopqrstuvwxyz0123456789AB"

Detailed Description

Purpose
-------
FS-507 regression coverage for Shannon entropy-based secret detection.

Responsibilities
----------------
- Validate ``_shannon_entropy()`` for known inputs.
- Validate ``_check_entropy_violations()`` for AST-level detection.
- Validate that ``check_no_hardcoded_secrets()`` integrates entropy checking.
- Validate threshold configurability and the ``--no-entropy`` opt-out.

Diagnostics
-----------
Domain: SECRET-SCAN-TESTS
    Levels:
        L2 — test lifecycle
        L3 — assertion details
        L4 — deep tracing

Contracts
---------
- Tests operate on in-memory strings and AST snippets; no files are
  written.

Variable Documentation

◆ _B64_TEST_STR

str tests_tools.test_entropy_detection._B64_TEST_STR = "aB3dE7fG9hJ2kL5mN8pQ1rS4tU6vW0xY"
protected

Definition at line 205 of file test_entropy_detection.py.

◆ _HIGH_ENTROPY_STR

str tests_tools.test_entropy_detection._HIGH_ENTROPY_STR = "abcdefghijklmnopqrstuvwxyz0123456789AB"
protected

Definition at line 209 of file test_entropy_detection.py.

◆ _MID_ENTROPY_STR

str tests_tools.test_entropy_detection._MID_ENTROPY_STR = "abcdefghijklmnopqrstuvwxyz01"
protected

Definition at line 207 of file test_entropy_detection.py.