Files
manual_slop/tests/test_ast_parser_curated.py
Ed_ 60396f03f8 refactor(types): auto -> None sweep across entire codebase
Applied 236 return type annotations to functions with no return values
across 100+ files (core modules, tests, scripts, simulations).
Added Phase 4 to python_style_refactor track for remaining 597 items
(untyped params, vars, and functions with return values).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 11:16:56 -05:00

41 lines
1.1 KiB
Python

import pytest
from file_cache import ASTParser
def test_ast_parser_get_curated_view() -> None:
parser = ASTParser("python")
code = '''
@core_logic
def core_func():
"""Core logic doc."""
print("this should be preserved")
return True
def hot_func():
# [HOT]
print("this should also be preserved")
return 42
def normal_func():
"""Normal doc."""
print("this should be stripped")
return None
class MyClass:
@core_logic
def core_method(self):
print("method preserved")
'''
curated = parser.get_curated_view(code)
# Check that core_func is preserved
assert 'print("this should be preserved")' in curated
assert 'return True' in curated
# Check that hot_func is preserved
assert '# [HOT]' in curated
assert 'print("this should also be preserved")' in curated
# Check that normal_func is stripped but docstring is preserved
assert '"""Normal doc."""' in curated
assert 'print("this should be stripped")' not in curated
assert '...' in curated
# Check that core_method is preserved
assert 'print("method preserved")' in curated