Files
FabledGrimoire/tests/test_services_repo_bindings.py
bvandeusenandClaude Opus 5.5 a07547447f
CI & Build / Python lint (push) Successful in 2s
CI & Build / Plugin hooks (push) Successful in 13s
CI & Build / TypeScript typecheck (push) Successful in 54s
CI & Build / integration (push) Successful in 1m1s
CI & Build / Python tests (push) Successful in 2m2s
CI & Build / Build & push image (push) Successful in 28s
rename(547): the repo is FabledGrimoire, and no stray "scribe" is left
The forge repo is now bvandeusen/FabledGrimoire. The plugin marketplace default,
the install commands in the docs and plugin README, the CI requirements title and
the example repo URLs in comments and tests follow it. docs/development.md now
names the image the build actually publishes, fabledgrimoire.

Two test names still said "scribes_own"; they now say "grimoires_own".

What still says scribe does so on purpose:
- the backup reader's accepted archive names and prefix;
- the label every stored secret is sealed under;
- the notes on keeping an old install's database names;
- the old migrations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 13:29:00 -04:00

42 lines
1.4 KiB
Python

import pytest
from grimoire.services.repo_bindings import normalize_repo_key
@pytest.mark.parametrize(
"raw",
[
"git@git.fabledsword.com:bvandeusen/fabledgrimoire.git",
"git@git.fabledsword.com:bvandeusen/FabledGrimoire.git",
"https://git.fabledsword.com/bvandeusen/fabledgrimoire.git",
"https://git.fabledsword.com/bvandeusen/fabledgrimoire",
"http://git.fabledsword.com/bvandeusen/fabledgrimoire.git",
"ssh://git@git.fabledsword.com:22/bvandeusen/fabledgrimoire.git",
"ssh://git@git.fabledsword.com/bvandeusen/fabledgrimoire",
"https://user:token@git.fabledsword.com/bvandeusen/fabledgrimoire.git",
],
)
def test_normalize_collapses_equivalent_remotes(raw):
assert normalize_repo_key(raw) == "git.fabledsword.com/bvandeusen/fabledgrimoire"
@pytest.mark.parametrize("raw", ["", " ", None])
def test_normalize_empty_inputs(raw):
assert normalize_repo_key(raw) == ""
def test_normalize_distinguishes_different_repos():
a = normalize_repo_key("git@host:owner/repo-a.git")
b = normalize_repo_key("git@host:owner/repo-b.git")
assert a == "host/owner/repo-a"
assert b == "host/owner/repo-b"
assert a != b
def test_normalize_preserves_nested_group_path():
# GitLab-style nested namespaces must survive normalization.
assert (
normalize_repo_key("https://gitlab.com/group/subgroup/repo.git")
== "gitlab.com/group/subgroup/repo"
)