MCPcopy Index your code
hub / github.com/getsops/sops / TestUnsetKeyNotFound

Function TestUnsetKeyNotFound

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

Source from the content-addressed store, hash-verified

1433}
1434
1435func TestUnsetKeyNotFound(t *testing.T) {
1436 branch := TreeBranch{
1437 TreeItem{
1438 Key: "foo",
1439 Value: TreeBranch{
1440 TreeItem{
1441 Key: "bar",
1442 Value: "bar",
1443 },
1444 },
1445 },
1446 }
1447 unset, err := branch.Unset([]interface{}{"foo", "unknown-value"})
1448 assert.Equal(t, err.(*SopsKeyNotFound).Key, "unknown-value")
1449 assert.ErrorContains(t, err, "unknown-value")
1450 assert.Nil(t, unset, "Unset result was not nil upon %s", err)
1451}
1452
1453func TestUnsetKeyInArrayNotFound(t *testing.T) {
1454 branch := TreeBranch{

Callers

nothing calls this directly

Calls 1

UnsetMethod · 0.95

Tested by

no test coverage detected