(t *testing.T)
| 9 | ) |
| 10 | |
| 11 | func TestLoadFromKey(t *testing.T) { |
| 12 | keyToReportTemplateSpec := map[string]ReportTemplateSpec{ |
| 13 | "default, nginx, Deployment (apps)": { |
| 14 | Namespace: "default", |
| 15 | Name: "nginx", |
| 16 | Kind: "Deployment", |
| 17 | API: "apps", |
| 18 | }, |
| 19 | "default, probes.monitoring.coreos.com, CustomResourceDefinition (apiextensions.k8s.io)": { |
| 20 | Namespace: "default", |
| 21 | Name: "probes.monitoring.coreos.com", |
| 22 | Kind: "CustomResourceDefinition", |
| 23 | API: "apiextensions.k8s.io", |
| 24 | }, |
| 25 | "default, my-cert, Certificate (cert-manager.io/v1)": { |
| 26 | Namespace: "default", |
| 27 | Name: "my-cert", |
| 28 | Kind: "Certificate", |
| 29 | API: "cert-manager.io/v1", |
| 30 | }, |
| 31 | } |
| 32 | |
| 33 | for key, expectedTemplateSpec := range keyToReportTemplateSpec { |
| 34 | templateSpec := &ReportTemplateSpec{} |
| 35 | require.NoError(t, templateSpec.loadFromKey(key)) |
| 36 | require.Equal(t, expectedTemplateSpec, *templateSpec) |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | func TestPrintDyffReport(t *testing.T) { |
| 41 | report := &Report{ |
nothing calls this directly
no test coverage detected