generated from coulomb/repo-seed
Add CARING examples and coverage
This commit is contained in:
@@ -30,6 +30,32 @@ func TestRegistryManifestsParse(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestExpandedRegistryExamplesParse(t *testing.T) {
|
||||
var subjects api.SubjectManifest
|
||||
loadYAML(t, filepath.Join("..", "..", "examples", "caring", "team_subject_manifest.yaml"), &subjects)
|
||||
if len(subjects.Teams) != 1 || subjects.Teams[0].ID != "team:project-reviewers" {
|
||||
t.Fatalf("subjects.Teams = %+v; want team:project-reviewers", subjects.Teams)
|
||||
}
|
||||
|
||||
var resources api.ResourceManifest
|
||||
loadYAML(t, filepath.Join("..", "..", "examples", "caring", "project_resource_manifest.yaml"), &resources)
|
||||
if len(resources.Resources) != 2 || resources.Resources[1].Parent != "project:alpha-redesign" {
|
||||
t.Fatalf("resources = %+v; want document inheriting from project", resources.Resources)
|
||||
}
|
||||
|
||||
var relationships []api.RelationshipFact
|
||||
loadYAML(t, filepath.Join("..", "..", "examples", "caring", "inherited_relationships.yaml"), &relationships)
|
||||
if len(relationships) != 2 {
|
||||
t.Fatalf("relationships len = %d; want 2", len(relationships))
|
||||
}
|
||||
if relationships[0].Caring == nil || relationships[0].Caring.CanonicalRole != api.CanonicalRoleVerifier {
|
||||
t.Fatalf("relationships[0].Caring = %+v; want Verifier descriptor", relationships[0].Caring)
|
||||
}
|
||||
if relationships[1].Relation != "inherits" {
|
||||
t.Fatalf("relationships[1].Relation = %q; want inherits", relationships[1].Relation)
|
||||
}
|
||||
}
|
||||
|
||||
func loadYAML(t *testing.T, path string, out any) {
|
||||
t.Helper()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user