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

Function TestKeyGroupsForFile

config/config_test.go:621–630  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

619}
620
621func TestKeyGroupsForFile(t *testing.T) {
622 conf, err := parseCreationRuleForFile(parseConfigFile(sampleConfig, t), "/conf/path", "foobar2000", nil)
623 assert.Nil(t, err)
624 assert.Equal(t, "2", conf.KeyGroups[0][0].ToString())
625 assert.Equal(t, "1", conf.KeyGroups[0][1].ToString())
626 conf, err = parseCreationRuleForFile(parseConfigFile(sampleConfig, t), "/conf/path", "whatever", nil)
627 assert.Nil(t, err)
628 assert.Equal(t, "bar", conf.KeyGroups[0][0].ToString())
629 assert.Equal(t, "foo", conf.KeyGroups[0][1].ToString())
630}
631
632func TestKeyGroupsForFileWithPath(t *testing.T) {
633 conf, err := parseCreationRuleForFile(parseConfigFile(sampleConfigWithPath, t), "/conf/path", "foo/bar2000", nil)

Callers

nothing calls this directly

Calls 3

parseCreationRuleForFileFunction · 0.85
parseConfigFileFunction · 0.85
ToStringMethod · 0.65

Tested by

no test coverage detected