Option C Tools
Loading...
Searching...
No Matches
tests_linter.test_dbg_assert_safety Namespace Reference

Functions

 test_dbg_assert_in_auth_function_flagged ()
 test_dbg_assert_in_harmless_function_passes ()
 test_dbg_assert_in_class_method_of_auth_class_flagged ()
 test_dbg_assert_in_security_module_flagged ()
 test_no_dbg_assert_calls_passes ()
 test_dbg_assert_attribute_call_flagged ()

Detailed Description

Purpose
-------
Validate the linter's ``dbg_assert_safety`` rule (OI-403 / AP-16).

Responsibilities
----------------
- Confirm that ``_dbg_assert`` calls inside security-sensitive functions
  are flagged.
- Confirm that ``_dbg_assert`` calls inside security-sensitive classes
  (via method scope) are flagged.
- Confirm that ``_dbg_assert`` calls inside modules with security-sensitive
  filenames are flagged.
- Confirm that ``_dbg_assert`` calls in ordinary contexts are not flagged.

Diagnostics
-----------
Domain: LINTER-TESTS
L2: test lifecycle
L3: assertion details
L4: deep tracing

Contracts
---------
Inputs:  inline source strings
Outputs: pass/fail assertions

Function Documentation

◆ test_dbg_assert_attribute_call_flagged()

tests_linter.test_dbg_assert_safety.test_dbg_assert_attribute_call_flagged ( )
Attribute-style ``oc_diagnostics._dbg_assert`` call is also flagged.

Definition at line 96 of file test_dbg_assert_safety.py.

◆ test_dbg_assert_in_auth_function_flagged()

tests_linter.test_dbg_assert_safety.test_dbg_assert_in_auth_function_flagged ( )
_dbg_assert inside a function whose name contains 'authenticate' is flagged.

Definition at line 36 of file test_dbg_assert_safety.py.

◆ test_dbg_assert_in_class_method_of_auth_class_flagged()

tests_linter.test_dbg_assert_safety.test_dbg_assert_in_class_method_of_auth_class_flagged ( )
_dbg_assert inside a method of a security-sensitive class is flagged.

Definition at line 60 of file test_dbg_assert_safety.py.

◆ test_dbg_assert_in_harmless_function_passes()

tests_linter.test_dbg_assert_safety.test_dbg_assert_in_harmless_function_passes ( )
_dbg_assert inside a harmless function is fine.

Definition at line 49 of file test_dbg_assert_safety.py.

◆ test_dbg_assert_in_security_module_flagged()

tests_linter.test_dbg_assert_safety.test_dbg_assert_in_security_module_flagged ( )
_dbg_assert in a module whose filename is security-sensitive is flagged.

Definition at line 73 of file test_dbg_assert_safety.py.

◆ test_no_dbg_assert_calls_passes()

tests_linter.test_dbg_assert_safety.test_no_dbg_assert_calls_passes ( )
Source without any _dbg_assert calls passes trivially.

Definition at line 84 of file test_dbg_assert_safety.py.