6859846b7c
- bootstrap 失败恢复 SSH 临时登录回退 - ssh_bootstrap 真安装检测与 config 目录自愈 - axs Gitea 发布源切换为 https://axs.kuma1xn.vip
22 lines
653 B
Python
22 lines
653 B
Python
"""nginx domain detect command builder."""
|
|
|
|
import pytest
|
|
|
|
from server.utils.nginx_domain_detect import build_nginx_domain_detect_command
|
|
|
|
|
|
def test_build_nginx_domain_detect_command_includes_baota_scan():
|
|
cmd = build_nginx_domain_detect_command()
|
|
assert "/www/server/panel/vhost/nginx" in cmd
|
|
assert "_is_domain" in cmd
|
|
|
|
|
|
def test_build_nginx_domain_detect_command_quotes_target_hint():
|
|
cmd = build_nginx_domain_detect_command(target_hint="a;rm -rf")
|
|
assert "'a;rm -rf'" in cmd
|
|
|
|
|
|
def test_build_nginx_domain_detect_command_empty_hint():
|
|
cmd = build_nginx_domain_detect_command(target_hint="")
|
|
assert "TARGET_HINT=''" in cmd
|