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

Function TestKeyGroupsForFileWithGroups

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

Source from the content-addressed store, hash-verified

645}
646
647func TestKeyGroupsForFileWithGroups(t *testing.T) {
648 conf, err := parseCreationRuleForFile(parseConfigFile(sampleConfigWithGroups, t), "/conf/path", "whatever", nil)
649 assert.Nil(t, err)
650 assert.Equal(t, "bar", conf.KeyGroups[0][0].ToString())
651 assert.Equal(t, "foo||bar", conf.KeyGroups[0][1].ToString())
652 assert.Equal(t, "foo|baz:bam", conf.KeyGroups[0][2].ToString())
653 assert.Equal(t, "foo|baz:bam|bar", conf.KeyGroups[0][3].ToString())
654 assert.Equal(t, "foo+123", conf.KeyGroups[0][4].ToString())
655 assert.Equal(t, "foo+123|baz:bam|bar", conf.KeyGroups[0][5].ToString())
656 assert.Equal(t, "qux", conf.KeyGroups[1][0].ToString())
657 assert.Equal(t, "baz||foo", conf.KeyGroups[1][1].ToString())
658}
659
660func TestLoadConfigFileWithUnencryptedSuffix(t *testing.T) {
661 conf, err := parseCreationRuleForFile(parseConfigFile(sampleConfigWithSuffixParameters, t), "/conf/path", "foobar", nil)

Callers

nothing calls this directly

Calls 3

parseCreationRuleForFileFunction · 0.85
parseConfigFileFunction · 0.85
ToStringMethod · 0.65

Tested by

no test coverage detected