feat: profiles rename_profile

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-21 19:51:52 +02:00
parent 9a0128b5fa
commit 71462071e4
2 changed files with 26 additions and 0 deletions
+13
View File
@@ -34,3 +34,16 @@ def test_create_duplicate_name_raises(tmp_path):
pr.create_profile(str(tmp_path), "setA", "id1")
with pytest.raises(ValueError):
pr.create_profile(str(tmp_path), "setA", "id2")
def test_rename_profile(tmp_path):
pr.create_profile(str(tmp_path), "old", "id1")
e = pr.rename_profile(str(tmp_path), "id1", "new")
assert e["name"] == "new"
assert pr.find_by_name(pr.read_registry(str(tmp_path)), "new")["id"] == "id1"
def test_rename_to_existing_name_raises(tmp_path):
import pytest
pr.create_profile(str(tmp_path), "a", "id1")
pr.create_profile(str(tmp_path), "b", "id2")
with pytest.raises(ValueError):
pr.rename_profile(str(tmp_path), "id2", "a")