Orchestrata Ultimate › Tests › Reference › verification › review

Tests reference — tests/verification/review

tests/verification/review — 9 test modules, 161 test functions. Source tree: tests/verification/review at commit 8a2cb42ad. Generated from the tests AST snapshot by scripts/gen-data-pages.py.

Prose pending.

Modules

Module Tests Covers
test_checks_correctness.py 18 1
test_checks_quality.py 22 1
test_checks_safety.py 37 1
test_checks_structure.py 30 1
test_engine.py 23 2
test_helpers.py 23 1
test_issue_triage.py 7 1
test_types.py 1 1

Module details

tests/verification/review/test_checks_correctness.py

source · 18 tests · 151 lines

Tests for verification.review.checks_correctness.

Covers: verification.review.checks_correctness

Kind Name Line Description
class TestCheckImports 34
method TestCheckImports.test_no_issues 35
method TestCheckImports.test_relative_import 41
method TestCheckImports.test_out_of_order 48
method TestCheckImports.test_correct_order 55
class TestBuildModuleCandidates 62
method TestBuildModuleCandidates.test_simple 63
method TestBuildModuleCandidates.test_nested 68
class TestCheckFileCompleteness 74
method TestCheckFileCompleteness.test_missing_module 75
method TestCheckFileCompleteness.test_module_exists 82
method TestCheckFileCompleteness.test_stdlib_skipped 90
class TestCheckEntryPoint 97
method TestCheckEntryPoint.test_main_file_with_guard 98
method TestCheckEntryPoint.test_main_file_missing_guard 103
method TestCheckEntryPoint.test_not_main_file 109
class TestCheckDependencyDeclaration 115
method TestCheckDependencyDeclaration.test_undeclared_dep 116
method TestCheckDependencyDeclaration.test_declared_dep_ok 123
method TestCheckDependencyDeclaration.test_stdlib_skipped 129
method TestCheckDependencyDeclaration.test_empty_declared_deps 135
method TestCheckDependencyDeclaration.test_alias_resolution 141
method TestCheckDependencyDeclaration.test_project_module_skipped 147

tests/verification/review/test_checks_quality.py

source · 22 tests · 174 lines

Tests for verification.review.checks_quality.

Covers: verification.review.checks_quality

Kind Name Line Description
class TestCheckTypeHints 33
method TestCheckTypeHints.test_no_issues_when_annotated 34
method TestCheckTypeHints.test_missing_return_annotation 40
method TestCheckTypeHints.test_missing_param_annotation 47
method TestCheckTypeHints.test_skips_private_functions 54
method TestCheckTypeHints.test_init_is_skipped_due_to_private_name 60
method TestCheckTypeHints.test_ignores_self_in_init 68
class TestCheckMutableDefaults 76
method TestCheckMutableDefaults.test_list_default 77
method TestCheckMutableDefaults.test_dict_default 84
method TestCheckMutableDefaults.test_set_literal_default 90
method TestCheckMutableDefaults.test_none_default_ok 96
method TestCheckMutableDefaults.test_constant_default_ok 102
method TestCheckMutableDefaults.test_kwonly_mutable_default 108
class TestCheckDocstrings 115
method TestCheckDocstrings.test_missing_function_docstring 116
method TestCheckDocstrings.test_has_docstring 123
method TestCheckDocstrings.test_missing_class_docstring 129
method TestCheckDocstrings.test_has_class_docstring 136
method TestCheckDocstrings.test_skips_private 142
class TestCheckLineLength 149
method TestCheckLineLength.test_short_lines_ok 150
method TestCheckLineLength.test_long_line_violation 155
method TestCheckLineLength.test_skips_url_lines 161
method TestCheckLineLength.test_limits_reported_violations 166
method TestCheckLineLength.test_counts_stripped_length 171

tests/verification/review/test_checks_safety.py

source · 37 tests · 336 lines

Covers: verification.review.checks_safety

Kind Name Line Description
function test_check_security_eval 50
function test_check_security_exec 59
function test_check_security_no_risk 67
function test_check_security_hardcoded_password 74
function test_check_security_hardcoded_api_key 82
function test_check_security_key_prefix_needs_a_token_start 91 sk- inside a hyphenated word is prose, not a key prefix.
function test_check_security_key_prefix_still_flags_real_keys 101 A real sk- literal and an AKIA key are flagged at a token start.
function test_check_security_skips_comment 111
function test_check_security_skips_os_environ 118
function test_check_security_skips_os_getenv 125
function test_check_security_multiple_issues 132
function test_check_todo_finds_todo 144
function test_check_todo_finds_fixme 151
function test_check_todo_finds_hack 157
function test_check_todo_finds_xxx 163
function test_check_todo_case_insensitive 169
function test_check_todo_skips_code 175
function test_check_todo_no_issues 181
function test_check_no_mocks_finds_mock_import 192
function test_check_no_mocks_finds_magicmock 199
function test_check_no_mocks_finds_patch 205
function test_check_no_mocks_finds_monkeypatch 211
function test_check_no_mocks_finds_fake_class 217
function test_check_no_mocks_skips_comments 223
function test_check_no_mocks_skips_empty 229
function test_check_no_mocks_no_violations 235
function test_validate_code_no_mocks_clean 246
function test_validate_code_no_mocks_violation 251
function test_validate_code_no_mocks_multiple 258
function test_check_lint_missing_linter 269
function test_check_lint_clean_file 277
function test_check_lint_undefined_name 285
function test_check_test_isolation_flags_unscoped_detach_delete 299
function test_check_test_isolation_flags_global_edge_delete 307
function test_check_test_isolation_flags_flushdb 314
function test_check_test_isolation_allows_param_scoped_delete 321
function test_check_test_isolation_ignores_prose_in_comments 333

tests/verification/review/test_checks_structure.py

source · 30 tests · 278 lines

Tests for verification.review.checks_structure.

Covers: verification.review.checks_structure

Kind Name Line Description
class TestCheckFunctionLength 37
method TestCheckFunctionLength.test_short_function_ok 38
method TestCheckFunctionLength.test_long_function_detected 44
class TestCheckFunctionArgs 52
method TestCheckFunctionArgs.test_few_args_ok 53
method TestCheckFunctionArgs.test_too_many_args 59
method TestCheckFunctionArgs.test_skips_self_in_methods 66
class TestCheckNoPlaceholder 74
method TestCheckNoPlaceholder.test_no_placeholder 75
method TestCheckNoPlaceholder.test_not_implemented_error_detected 81
method TestCheckNoPlaceholder.test_pass_only_is_placeholder 88
method TestCheckNoPlaceholder.test_docstring_and_pass_is_placeholder 95
class TestCheckErrorHandling 103
method TestCheckErrorHandling.test_bare_except_detected 104
method TestCheckErrorHandling.test_specific_except_ok 118
method TestCheckErrorHandling.test_no_try_except_ok 130
class TestCheckNestingDepth 137
method TestCheckNestingDepth.test_shallow_nesting_ok 138
method TestCheckNestingDepth.test_deep_nesting_detected 145
class TestCheckGodObjects 162
method TestCheckGodObjects.test_small_class_ok 163
method TestCheckGodObjects.test_large_class_detected 170
method TestCheckGodObjects.test_too_many_public_methods 177
method TestCheckGodObjects.test_long_file_detected 184
method TestCheckGodObjects.test_class_too_many_lines 191
class TestCheckStubMethods 199
method TestCheckStubMethods.test_skips_test_files 200
method TestCheckStubMethods.test_real_method_not_stub 207
method TestCheckStubMethods.test_pass_only_is_stub 214
method TestCheckStubMethods.test_assign_and_return_is_stub 222
method TestCheckStubMethods.test_external_call_not_stub 230
method TestCheckStubMethods.test_await_not_stub 237
method TestCheckStubMethods.test_docstring_only_is_stub 244
method TestCheckStubMethods.test_log_call_not_stub 252
method TestCheckStubMethods.test_print_not_stub 259
method TestCheckStubMethods.test_expr_statement_not_stub 266
method TestCheckStubMethods.test_docstring_only_skipped 273

tests/verification/review/test_engine.py

source · 23 tests · 225 lines

Covers: verification.review.engine, verification.review.types

Kind Name Line Description
function test_split_files_empty 45
function test_split_files_source_only 51
function test_split_files_test_prefix 57
function test_split_files_tests_dir 63
function test_split_files_non_py_ignored 69
function test_is_test_file_by_prefix 80
function test_is_test_file_by_dir 84
function test_is_test_file_source 88
function test_collect_workspace_files 97
function test_collect_workspace_files_empty 106
function test_detect_project_modules_src_layout 116
function test_detect_project_modules_flat_layout 124
function test_detect_project_modules_no_packages 132
function test_discover_extra_tests 142
function test_discover_extra_tests_skips_existing 149
function test_format_review_report_empty 160
function test_format_review_report_with_issues 165
function test_format_review_report_truncates 177
function test_review_single_file_missing 188
function test_review_single_file_syntax_error 193
function test_review_single_file_valid_source 200
function test_run_deterministic_review_empty_workspace 215
function test_run_deterministic_review_with_files 220

tests/verification/review/test_helpers.py

source · 23 tests · 170 lines

Tests for verification.review.helpers.

Covers: verification.review.helpers

Kind Name Line Description
class TestParseFile 37
method TestParseFile.test_valid_python 38
method TestParseFile.test_syntax_error_returns_none 44
method TestParseFile.test_missing_file_returns_none 49
class TestReadLines 53
method TestReadLines.test_reads_file 54
method TestReadLines.test_missing_file_returns_empty 60
class TestIsPublic 64
method TestIsPublic.test_public 65
method TestIsPublic.test_private 69
class TestFunctionLineCount 74
method TestFunctionLineCount.test_simple_function 75
method TestFunctionLineCount.test_with_docstring 81
method TestFunctionLineCount.test_empty_function 87
method TestFunctionLineCount.test_only_docstring 93
class TestGetPyprojectDeps 100
method TestGetPyprojectDeps.test_extracts_dependencies 101
method TestGetPyprojectDeps.test_no_pyproject 110
method TestGetPyprojectDeps.test_no_dependencies_section 113
method TestGetPyprojectDeps.test_normalizes_dashes 118
method TestGetPyprojectDeps.test_oserror_on_pyproject_dir 124
class TestCollectImportedModules 131
method TestCollectImportedModules.test_import_statements 132
method TestCollectImportedModules.test_import_from 138
method TestCollectImportedModules.test_relative_import_ignored 144
method TestCollectImportedModules.test_mixed_imports 150
class TestReadWorkspaceFiles 158
method TestReadWorkspaceFiles.test_reads_existing_files 159
method TestReadWorkspaceFiles.test_missing_file_noted 165
method TestReadWorkspaceFiles.test_empty_list 169

tests/verification/review/test_issue_triage.py

source · 7 tests · 84 lines

Tests for verification.review.issue_triage.

Covers: verification.review.issue_triage

Kind Name Line Description
class TestPrioritizeIssues 26
method TestPrioritizeIssues.test_empty_list 27
method TestPrioritizeIssues.test_single_issue 30
method TestPrioritizeIssues.test_critical_before_cosmetic 33
method TestPrioritizeIssues.test_file_complete_first 47
method TestPrioritizeIssues.test_capping 56
method TestPrioritizeIssues.test_untagged_middle_priority 61
method TestPrioritizeIssues.test_all_cosmetic 73

tests/verification/review/test_types.py

source · 1 tests · 28 lines

Tests for verification.review.types.

Covers: verification.review.types

Kind Name Line Description
class TestIssueType 26
method TestIssueType.test_issue_is_tuple_alias 27

Support files

Fixtures, package markers and helpers without test functions.