The three tests of the controller's own module.json (process, claimed seat, addresses), the Dockerfile and Makefile pin test, the build-agent registry test and the manifest-in-use seat test move with their old package, as tests of mesh-sdk's exported API; a moved test is exempt from failing first.
29 lines
979 B
Go
29 lines
979 B
Go
package inventory
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
|
|
"git.novox.be/novox/mesh-sdk/go/catalogue"
|
|
)
|
|
|
|
// `give` takes only a value nobody but a person has (the review of 2026-10-09, M4): never the module's bus
|
|
// account, which `issue` mints, nor a secret the mesh may make itself.
|
|
func TestOnlyASecretThePersonHoldsIsGivenAtTheDesk(t *testing.T) {
|
|
m := catalogue.Manifest{Module: "telegram", OwnSecrets: catalogue.OwnSecrets{
|
|
"telegram-token": {Path: "/s/telegram-token"},
|
|
"broker": {Path: "/s/broker"},
|
|
"session": {Path: "/s/session", Taken: catalogue.TakenAtStart},
|
|
}}
|
|
if err := GivableAtDesk(m, "telegram-token"); err != nil {
|
|
t.Errorf("the bot token was refused: %v", err)
|
|
}
|
|
for _, name := range []string{"broker", "session", "chat-id"} {
|
|
if err := GivableAtDesk(m, name); err == nil {
|
|
t.Errorf("%s was givable", name)
|
|
} else if name != "chat-id" && !strings.Contains(err.Error(), "the mesh makes") {
|
|
t.Errorf("%s: %v", name, err)
|
|
}
|
|
}
|
|
}
|