test_sigil_activity_302.py
python
sha256:c4c154d26740ebed7e38471f96d2f3eadd64677fa3d8ad35a2a2e0593e0f9bfd
fix(profiles): sigil dots reflect activity — repositories p…
Opus 5.5
patch
1 day ago
| 1 | """musehub#302: sigil dots reflect the owner's activity (repositories per domain).""" |
| 2 | from __future__ import annotations |
| 3 | |
| 4 | import pytest |
| 5 | from sqlalchemy.ext.asyncio import AsyncSession |
| 6 | |
| 7 | from musehub.services.spectral_sigil import generate_sigil, owner_domain_counts |
| 8 | from tests.factories import create_repo |
| 9 | |
| 10 | |
| 11 | @pytest.mark.asyncio |
| 12 | async def test_counts_repositories_per_domain(db_session: AsyncSession) -> None: |
| 13 | await create_repo(db_session, owner="sigil-owner", slug="a", domain_id="code") |
| 14 | await create_repo(db_session, owner="sigil-owner", slug="b", domain_id="code") |
| 15 | await create_repo(db_session, owner="sigil-owner", slug="c", domain_id="mist") |
| 16 | await create_repo(db_session, owner="someone-else", slug="d", domain_id="code") |
| 17 | await db_session.commit() |
| 18 | assert await owner_domain_counts(db_session, "sigil-owner") == {"code": 2, "mist": 1} |
| 19 | assert await owner_domain_counts(db_session, "nobody") == {} |
| 20 | |
| 21 | |
| 22 | def test_active_dots_change_the_sigil() -> None: |
| 23 | dormant = generate_sigil(identity_id="a" * 64, handle="x", identity_type="human", domain_counts={}) |
| 24 | active = generate_sigil(identity_id="a" * 64, handle="x", identity_type="human", domain_counts={"code": 3}) |
| 25 | assert dormant != active |
File History
1 commit
sha256:c4c154d26740ebed7e38471f96d2f3eadd64677fa3d8ad35a2a2e0593e0f9bfd
fix(profiles): sigil dots reflect activity — repositories p…
Opus 5.5
patch
1 day ago