修正跨平台部署审查用例

This commit is contained in:
xuans committed 2026-10-01 14:06:17 +08:00
1 parent 7e9c0aee5f
commit 18d84b5157
3 files changed
+19 -6

No files matched your search

+6 -2
View File
@@ -13,10 +13,14 @@ from unittest.mock import patch
BASE = Path(__file__).resolve().parent
SCRIPTS = BASE if (BASE / 'renew_certificate.py').exists() else BASE.parents[1] / 'deploy/nginx'
sys.path.insert(0, str(SCRIPTS))
with patch.dict(os.environ, {'SMAIL_MAIL_DOMAIN': 'cdis.cn', 'SMAIL_WEB_DOMAIN': 'web.cdis.cn'}):
import renew_certificate as renew
if os.name == 'posix':
with patch.dict(os.environ, {'SMAIL_MAIL_DOMAIN': 'cdis.cn', 'SMAIL_WEB_DOMAIN': 'web.cdis.cn'}):
import renew_certificate as renew
else:
renew = None
@unittest.skipUnless(os.name == 'posix', '证书部署脚本仅支持 Linux/Unix')
class WebrootTests(unittest.TestCase):
def setUp(self):
self.directory = Path(tempfile.mkdtemp(prefix='webroot-tests-', dir=Path.cwd()))