You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: deploy/charts/disco-agent/tests/__snapshot__/configmap_test.yaml.snap
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,8 @@ custom-cluster-description:
7
7
cluster_description: "A cloud hosted Kubernetes cluster hosting production workloads.\n\nteam: team-1\nemail: team-1@example.com\npurpose: Production workloads\n"
// TestExtractOIDCFromReading tests the extractOIDCFromReading function.
130
+
funcTestExtractOIDCFromReading(t*testing.T) {
131
+
typetestCasestruct {
132
+
namestring
133
+
reading*api.DataReading
134
+
expectedSnapshot dataupload.Snapshot
135
+
expectErrorstring
136
+
}
137
+
tests:= []testCase{
138
+
{
139
+
name: "nil reading",
140
+
expectError: `programmer mistake: the DataReading must not be nil`,
141
+
},
142
+
{
143
+
name: "nil data",
144
+
reading: &api.DataReading{
145
+
DataGatherer: "ark/oidc",
146
+
Data: nil,
147
+
},
148
+
expectError: `programmer mistake: the DataReading must have data type *api.OIDCDiscoveryData. This DataReading (ark/oidc) has data type <nil>`,
149
+
},
150
+
{
151
+
name: "wrong data type",
152
+
reading: &api.DataReading{
153
+
DataGatherer: "ark/oidc",
154
+
Data: &api.DiscoveryData{},
155
+
},
156
+
expectError: `programmer mistake: the DataReading must have data type *api.OIDCDiscoveryData. This DataReading (ark/oidc) has data type *api.DiscoveryData`,
0 commit comments