import os
import glob
import re

for file in glob.glob("tests/e2e/test_workflow_*.py"):
    with open(file, "r") as f:
        content = f.read()
    
    # Remove FakeSAENormal class definition
    content = re.sub(r'class FakeSAENormal:\n(?: {4}.*\n)+', '', content)
    
    # Remove monkeypatch.setattr for SituationalAwarenessEngine
    content = re.sub(r' +monkeypatch\.setattr\(\n +["\']GramAddict\.core\.behaviors\.obstacle_guard\.SituationalAwarenessEngine["\'],\n +FakeSAENormal,?\n +\)\n', '', content)
    # Also inline ones
    content = re.sub(r' +monkeypatch\.setattr\("GramAddict\.core\.behaviors\.obstacle_guard\.SituationalAwarenessEngine", FakeSAENormal\)\n', '', content)

    with open(file, "w") as f:
        f.write(content)
print("Removed FakeSAENormal from all tests")
