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

Function TestEncodeIniWithDuplicateSections

stores/ini/store_test.go:130–177  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

128}
129
130func TestEncodeIniWithDuplicateSections(t *testing.T) {
131 branches := sops.TreeBranches{
132 sops.TreeBranch{
133 sops.TreeItem{
134 Key: "DEFAULT",
135 Value: interface{}(sops.TreeBranch(nil)),
136 },
137 sops.TreeItem{
138 Key: "foo",
139 Value: sops.TreeBranch{
140 sops.TreeItem{
141 Key: "foo",
142 Value: "bar",
143 },
144 sops.TreeItem{
145 Key: "baz",
146 Value: "3.0",
147 },
148 sops.TreeItem{
149 Key: "qux",
150 Value: "false",
151 },
152 },
153 },
154 sops.TreeItem{
155 Key: "foo",
156 Value: sops.TreeBranch{
157 sops.TreeItem{
158 Key: "foo",
159 Value: "bar",
160 },
161 sops.TreeItem{
162 Key: "baz",
163 Value: "3.0",
164 },
165 sops.TreeItem{
166 Key: "qux",
167 Value: "false",
168 },
169 },
170 },
171 },
172 }
173 out, err := Store{}.iniFromTreeBranches(branches)
174 assert.Nil(t, err)
175 expected, _ := Store{}.treeBranchesFromIni(out)
176 assert.Equal(t, expected, branches)
177}
178
179func TestUnmarshalMetadataFromNonSOPSFile(t *testing.T) {
180 data := []byte(`hello=2`)

Callers

nothing calls this directly

Calls 2

iniFromTreeBranchesMethod · 0.80
treeBranchesFromIniMethod · 0.80

Tested by

no test coverage detected