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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions scripts/aaa_quality.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ def check_bandit(target_dir):
print("[AAA PASSED] Bandit Security")
return True

def check_radon,
check_quantum_crypto(target_dir):
def check_radon(target_dir):
print("[AAA] Running Radon (Cyclomatic Complexity)...")
# Fail if any function has a complexity score of 'C' or worse (score > 10)
code, stdout, stderr = run_command("radon cc -nc .", target_dir)
Expand Down
28 changes: 28 additions & 0 deletions tests/test_aaa_quality_imports.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import unittest
import sys
import os

sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../scripts')))
import aaa_quality


class TestAAAQualityImports(unittest.TestCase):
"""Guards against the syntax error that made aaa_quality unimportable.

A malformed `def check_radon, check_quantum_crypto(target_dir):` once
fused two function names, raising SyntaxError on import and silently
disabling the entire AAA Quality pre-gate. Importing the module here and
asserting its check_* functions exist catches any regression.
"""

def test_module_imports(self):
self.assertTrue(hasattr(aaa_quality, 'run_aaa_suite'))

def test_expected_checks_exist(self):
for name in ('check_flake8', 'check_bandit', 'check_radon', 'check_quantum_crypto'):
self.assertTrue(callable(getattr(aaa_quality, name, None)),
f"expected callable aaa_quality.{name}")


if __name__ == '__main__':
unittest.main()
Loading