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

Function TestExtractMetadata

stores/metadata_test.go:18–1007  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

16)
17
18func TestExtractMetadata(t *testing.T) {
19 var (
20 broken1 = sops.TreeBranch{
21 sops.TreeItem{
22 Key: "foo",
23 Value: "bar",
24 },
25 }
26 broken2 = sops.TreeBranch{
27 sops.TreeItem{
28 Key: "sops",
29 Value: "foo",
30 },
31 }
32 empty = sops.TreeBranch{
33 sops.TreeItem{
34 Key: "sops",
35 Value: sops.TreeBranch{},
36 },
37 }
38
39 minimal1 = sops.TreeBranch{
40 sops.TreeItem{
41 Key: "sops",
42 Value: sops.TreeBranch{
43 sops.TreeItem{
44 Key: "LastModified",
45 Value: "2025-03-23T10:20:30Z",
46 },
47 },
48 },
49 }
50 minimal2 = sops.TreeBranch{
51 sops.TreeItem{
52 Key: "sops",
53 Value: sops.TreeBranch{
54 sops.TreeItem{
55 Key: "lastmodified",
56 Value: "2025-03-23T10:20:30Z",
57 },
58 sops.TreeItem{
59 Key: "pgp",
60 Value: []interface{}{
61 sops.TreeBranch{
62 sops.TreeItem{
63 Key: "created_at",
64 Value: "2025-03-23T10:20:29Z",
65 },
66 sops.TreeItem{
67 Key: "enc",
68 Value: "ABCD",
69 },
70 sops.TreeItem{
71 Key: "fp",
72 Value: "1234",
73 },
74 },
75 },

Callers

nothing calls this directly

Calls 2

ExtractMetadataFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected