Improve SMB credential handling for AI structure
This commit is contained in:
@@ -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(
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user