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

Function TestUnsetKeyInArrayNotFound

sops_test.go:1453–1470  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1451}
1452
1453func TestUnsetKeyInArrayNotFound(t *testing.T) {
1454 branch := TreeBranch{
1455 TreeItem{
1456 Key: "foo",
1457 Value: []interface{}{
1458 TreeBranch{
1459 TreeItem{
1460 Key: "bar",
1461 Value: "bar",
1462 },
1463 },
1464 },
1465 },
1466 }
1467 unset, err := branch.Unset([]interface{}{"foo", 0, "unknown"})
1468 assert.Equal(t, err.(*SopsKeyNotFound).Key, "unknown")
1469 assert.Nil(t, unset, "Unset result was not nil upon %s", err)
1470}
1471
1472func TestUnsetArrayItemOutOfBounds(t *testing.T) {
1473 branch := TreeBranch{

Callers

nothing calls this directly

Calls 1

UnsetMethod · 0.95

Tested by

no test coverage detected