Skip to main content

CODITECT Script Validation Test Suite

Comprehensive tests to verify all 233 scripts have correct syntax, proper documentation headers, and valid structure.

Run: python3 scripts/tests/test_scripts.py python3 scripts/tests/test_scripts.py -v # Verbose python3 scripts/tests/test_scripts.py --script invoke-agent # Single script

Author: CODITECT Team Version: 1.0.0 Created: 2025-12-22

File: test_scripts.py

Classes

Colors

No description

TestResult

No description

ScriptValidation

No description

ScriptTestSuite

Comprehensive test suite for CODITECT scripts

Functions

get_framework_root()

Get framework root directory

main()

No description

get_all_scripts()

Get all script files with their types

test_file_exists(script_path, script_name)

Test that script file exists and is readable

test_python_syntax(script_path, script_name)

Test Python script syntax

test_shell_syntax(script_path, script_name)

Test shell script syntax using bash -n

test_has_shebang(script_path, script_name, script_type)

Test that script has proper shebang line

test_has_docstring(script_path, script_name, script_type)

Test that script has documentation header

test_no_hardcoded_paths(script_path, script_name)

Test that script doesn't have hardcoded absolute paths

test_no_secrets(script_path, script_name)

Test that script doesn't contain potential secrets

test_is_executable(script_path, script_name)

Test that script has executable permissions (warning only)

test_minimum_content(script_path, script_name)

Test that script has minimum content

validate_script(script_path, script_type)

Run all validation tests on a script

run_all(specific_script)

Run validation on all scripts

Usage

python test_scripts.py