Download tests/security/test_debug_class.py from techprotrade/annator-command-center: direct link, hf CLI and curl.
- Browser
- Download file 1.27 kB
-
https://huggingface.co/spaces/techprotrade/annator-command-center/resolve/main/tests/security/test_debug_class.py
- Command line
-
hf download hf://spaces/techprotrade/annator-command-center/tests/security/test_debug_class.py
-
curl -L -o test_debug_class.py https://huggingface.co/spaces/techprotrade/annator-command-center/resolve/main/tests/security/test_debug_class.py
1.27 kB
| import os | |
| import sys | |
| from unittest.mock import MagicMock | |
| # Fix path | |
| sys.path.append(os.path.join(os.getcwd(), 'backend')) | |
| sys.path.append(os.getcwd()) | |
| # Mock | |
| sys.modules['anthropic'] = MagicMock() | |
| sys.modules['google.generativeai'] = MagicMock() | |
| sys.modules['zhipuai'] = MagicMock() | |
| sys.modules['instructor'] = MagicMock() | |
| def test_debug(): | |
| try: | |
| from enhanced_ai_workflow_endpoints import RealAIWorkflowService | |
| print("Class imported successfully.") | |
| print("Attributes in RealAIWorkflowService:") | |
| found = False | |
| for x in dir(RealAIWorkflowService): | |
| if "get_" in x: | |
| print(f" - {x}") | |
| if "get_session" in x: found = True | |
| if not found: | |
| print("CRITICAL: get_session NOT found in dir()") | |
| service = RealAIWorkflowService() | |
| print("Instance created.") | |
| try: | |
| service.get_session("test") | |
| print("get_session called successfully.") | |
| except Exception as e: | |
| print(f"get_session failed: {e}") | |
| except ImportError as e: | |
| print(f"ImportError: {e}") | |
| except Exception as e: | |
| import traceback | |
| traceback.print_exc() | |
| if __name__ == "__main__": | |
| test_debug() | |