mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-09 04:06:42 +00:00
i18n/names kept a private _sources() that walked the role directories, read the README heading and added galaxy_info.name. The brand rule needs the same knowledge, and a second copy is the drift that has already bitten this branch twice. The three readers live under utils/meta now. titles also pins the precedence that was implicit: the README heading wins over galaxy_info.name, because the documentation is built from the heading. authors stays thin on purpose - the derivation from the Credits sections belongs to utils/roles/credits, and this is only the entry point for a reader that wants the names without the URLs. The titles arrive sorted and deduplicated rather than in read order, which the alternation built from them does not notice: it sorts by length itself. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
31 lines
907 B
Python
31 lines
907 B
Python
from __future__ import annotations
|
|
|
|
import unittest
|
|
|
|
from utils.meta.authors import author_names
|
|
from utils.roles.credits import author_urls
|
|
from utils.software import SOFTWARE_AUTHOR
|
|
|
|
|
|
class TestAuthorNames(unittest.TestCase):
|
|
def test_the_credited_people_are_listed(self) -> None:
|
|
self.assertIn(SOFTWARE_AUTHOR, author_names())
|
|
|
|
def test_the_names_are_sorted_and_unique(self) -> None:
|
|
names = author_names()
|
|
|
|
self.assertEqual(list(names), sorted(names))
|
|
self.assertEqual(len(names), len(set(names)))
|
|
|
|
def test_it_carries_exactly_the_keys_of_the_url_map(self) -> None:
|
|
self.assertEqual(
|
|
set(author_names()),
|
|
set(author_urls()),
|
|
"the names are the map's keys, not a second list that could drift "
|
|
"from the Credits sections they are derived from",
|
|
)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|