Read the declaration a served-key test checks from the composition, since the plan verb is gone (issue 1945)
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"git.novox.be/novox/mesh-sdk/go/catalogue"
|
"git.novox.be/novox/mesh-sdk/go/catalogue"
|
||||||
|
"git.novox.be/novox/mesh-sdk/go/compose"
|
||||||
|
|
||||||
"github.com/novox/mesh-controller/internal/broker"
|
"github.com/novox/mesh-controller/internal/broker"
|
||||||
)
|
)
|
||||||
@@ -212,8 +213,12 @@ func TestAServedKeyIsRefusedThroughAVerb(t *testing.T) {
|
|||||||
refused("a setting a trusted file asks for, through the verb", throughVerb(t, "settings", map[string]any{
|
refused("a setting a trusted file asks for, through the verb", throughVerb(t, "settings", map[string]any{
|
||||||
"module": "power", "node": "anchor", "values": `{"lid":"ignore","x":0}`}))
|
"module": "power", "node": "anchor", "values": `{"lid":"ignore","x":0}`}))
|
||||||
// And `trusted` is the catalogue's word: it never reaches the machine, whose engine parses strictly.
|
// And `trusted` is the catalogue's word: it never reaches the machine, whose engine parses strictly.
|
||||||
plan := printed(t, func() error { return atTheTerminal(t, "plan", "anchor", "--json") })
|
declared, _, err := composeQuestion(ctx, open, "anchor", compose.Reading, false)
|
||||||
if strings.Contains(plan, `"trusted"`) {
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
body, _ := json.Marshal(declared.Resources)
|
||||||
|
if strings.Contains(string(body), `"trusted"`) {
|
||||||
t.Fatal("the declaration carries the catalogue's `trusted`")
|
t.Fatal("the declaration carries the catalogue's `trusted`")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user