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

Function TestKeyGroupsForFileWithPath

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

Source from the content-addressed store, hash-verified

630}
631
632func TestKeyGroupsForFileWithPath(t *testing.T) {
633 conf, err := parseCreationRuleForFile(parseConfigFile(sampleConfigWithPath, t), "/conf/path", "foo/bar2000", nil)
634 assert.Nil(t, err)
635 assert.Equal(t, "2", conf.KeyGroups[0][0].ToString())
636 assert.Equal(t, "1", conf.KeyGroups[0][1].ToString())
637 conf, err = parseCreationRuleForFile(parseConfigFile(sampleConfigWithPath, t), "/conf/path", "somefilename.yml", nil)
638 assert.Nil(t, err)
639 assert.Equal(t, "baggins", conf.KeyGroups[0][0].ToString())
640 assert.Equal(t, "bilbo", conf.KeyGroups[0][1].ToString())
641 conf, err = parseCreationRuleForFile(parseConfigFile(sampleConfig, t), "/conf/path", "whatever", nil)
642 assert.Nil(t, err)
643 assert.Equal(t, "bar", conf.KeyGroups[0][0].ToString())
644 assert.Equal(t, "foo", conf.KeyGroups[0][1].ToString())
645}
646
647func TestKeyGroupsForFileWithGroups(t *testing.T) {
648 conf, err := parseCreationRuleForFile(parseConfigFile(sampleConfigWithGroups, t), "/conf/path", "whatever", nil)

Callers

nothing calls this directly

Calls 3

parseCreationRuleForFileFunction · 0.85
parseConfigFileFunction · 0.85
ToStringMethod · 0.65

Tested by

no test coverage detected