feat: 完成 issue #48 DLP 敏感数据拦截(目标 100% 拦截)
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""测试引导:把 `core/llm-gateway` 以包名 `llm_gateway` 挂载到 sys.modules。
|
||||
|
||||
目录名 `llm-gateway` 含连字符,无法直接以包名 import;挂载后模块内相对导入
|
||||
(`from .dlp import ...`)在 unittest 发现机制下可正常解析。
|
||||
"""
|
||||
import os
|
||||
import sys
|
||||
import types
|
||||
|
||||
LLM_GW_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
sys.path.insert(0, LLM_GW_DIR)
|
||||
if "llm_gateway" not in sys.modules:
|
||||
pkg = types.ModuleType("llm_gateway")
|
||||
pkg.__path__ = [LLM_GW_DIR]
|
||||
sys.modules["llm_gateway"] = pkg
|
||||
Reference in New Issue
Block a user