Improve SMB credential handling for AI structure
CI / python (push) Has been cancelled
CI / rust (push) Has been cancelled

This commit is contained in:
2026-05-22 00:20:04 +03:00
parent afb455a2c6
commit 23800dea71
2 changed files with 69 additions and 8 deletions
+22
View File
@@ -1310,6 +1310,28 @@ def test_server_smb_browse_validates_unc_path():
assert "UNC путь" in response.json()["error"]
def test_smb_credentials_embedded_domain_format_is_normalized():
from api_server import smb_paths
domain, username = smb_paths._normalize_credentials("MST\\m", None)
assert domain == "MST"
assert username == "m"
def test_smb_error_translation_returns_russian_auth_message():
from api_server import smb_paths
message = smb_paths._translate_smb_error(
RuntimeError("STATUS_LOGON_FAILURE: logon failure"),
server="192.168.220.200",
username="MST\\m",
)
assert "Ошибка авторизации SMB" in message
assert "Проверьте логин, пароль, домен" in message
def test_project_setup_recovers_indexed_status_from_stored_snapshot(tmp_path: Path):
(tmp_path / "metadata.xml").write_text(
"""