info-tech-canon/tests/test_social_collectives.py

16 lines
829 B
Python
Raw Normal View History

from info_tech_canon.generation import concept_ownership
from info_tech_canon.service import load_context
def test_social_collectives_have_one_owner_and_family_is_not_a_subtype():
context = load_context()
rows = concept_ownership(context)["concepts"]
for concept in ["Community", "Household"]:
assert {r["owner"] for r in rows if r["concept"] == concept} == {"model/organization"}
text = (context.infospace_root / "models/organization/InfoTechCanonOrganizationModel.md").read_text()
taxonomy = text.split("# 9. Root Organization Taxonomy", 1)[1].split("# 10.", 1)[0]
assert "CollectiveActor\n│ ├── Community\n│ └── Household" in taxonomy
assert taxonomy.count("Community") == 1
assert "Family" not in taxonomy
assert "A Household is not a Family" in text