MCPcopy
hub / github.com/getsops/sops / TestDecodeNestedJSONObject

Function TestDecodeNestedJSONObject

stores/json/store_test.go:195–211  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

193}
194
195func TestDecodeNestedJSONObject(t *testing.T) {
196 in := `{"foo": {"foo": "bar"}}`
197 expected := sops.TreeBranch{
198 sops.TreeItem{
199 Key: "foo",
200 Value: sops.TreeBranch{
201 sops.TreeItem{
202 Key: "foo",
203 Value: "bar",
204 },
205 },
206 },
207 }
208 branch, err := Store{}.treeBranchFromJSON([]byte(in))
209 assert.Nil(t, err)
210 assert.Equal(t, expected, branch)
211}
212
213func TestDecodeJSONWithArray(t *testing.T) {
214 in := `{"foo": {"foo": [1, 2, 3]}, "bar": "baz"}`

Callers

nothing calls this directly

Calls 1

treeBranchFromJSONMethod · 0.80

Tested by

no test coverage detected