Add XML export preflight for AI structure
CI / python (push) Has been cancelled
CI / rust (push) Has been cancelled

This commit is contained in:
2026-05-22 15:08:36 +03:00
parent d8394e4e89
commit 58afd3932e
3 changed files with 155 additions and 1 deletions
+26
View File
@@ -2365,6 +2365,32 @@ def test_html5_ai_structure_check_path_reports_root_mismatch():
assert "доступны только корни" in checked.text
def test_html5_ai_structure_check_path_reports_xml_export_layout(tmp_path: Path):
source = tmp_path / "xml-export"
(source / "Конфигурация").mkdir(parents=True)
(source / "CRM").mkdir(parents=True)
(source / "Конфигурация" / "metadata.xml").write_text("<Configuration />", encoding="utf-8")
(source / "CRM" / "РасширениеCRM.mdo").write_text("<ConfigurationExtension />", encoding="utf-8")
client = TestClient(app)
project_id = f"ai-xml-check-{uuid4()}"
settings = client.post(
f"/projects/{project_id}/settings",
json={"name": "AI XML Check", "structure_source": "XML_DUMP"},
)
assert settings.status_code == 200
checked = client.post(
f"/html5/projects/{project_id}/ai-structure/check-path",
data={"input_path": str(source)},
)
assert checked.status_code == 200
assert "Сервер видит выгрузку 1С" in checked.text
assert "Конфигурация + отдельные папки расширений" in checked.text
assert "Главная папка: Конфигурация" in checked.text
assert "Папки расширений: CRM" in checked.text
def test_import_full_replace_replaces_current_normalized_project(tmp_path: Path):
first = tmp_path / "first"
second = tmp_path / "second"