Files
Nexus/tests/test_nginx_domain_detect.py
T

22 lines
653 B
Python
Raw Normal View History

"""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