Skip to content

Commit

Permalink
Update Tests
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Jogeleit <frank.jogeleit@web.de>
  • Loading branch information
fjogeleit committed Aug 31, 2023
1 parent 0835583 commit da46f7d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 0 additions & 1 deletion pkg/email/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ type Report struct {
Message string
Format string
ClusterName string
TitlePrefix string
}

type Reporter interface {
Expand Down
6 changes: 4 additions & 2 deletions pkg/email/summary/reporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"os"
"testing"
"time"

v1 "k8s.io/apimachinery/pkg/apis/meta/v1"

Expand Down Expand Up @@ -50,8 +51,9 @@ func Test_CreateReport(t *testing.T) {
if report.ClusterName != "Cluster" {
t.Fatal("expected clustername to be set")
}
if report.TitlePrefix != "Report" {
t.Fatal("expected titleprefix to be set")
expected := "Report (summary) on Cluster from " + time.Now().Format("2006-01-02")
if report.Title != expected {
t.Fatalf("expected title to be '%s', got %s", expected, report.Title)
}
if report.Format != "html" {
t.Fatal("expected format to be set")
Expand Down
6 changes: 4 additions & 2 deletions pkg/email/violations/reporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"os"
"testing"
"time"

v1 "k8s.io/apimachinery/pkg/apis/meta/v1"

Expand Down Expand Up @@ -50,8 +51,9 @@ func Test_CreateReport(t *testing.T) {
if report.ClusterName != "Cluster" {
t.Fatal("expected clustername to be set")
}
if report.TitlePrefix != "Report" {
t.Fatal("expected titleprefix to be")
expected := "Report (violations) on Cluster from " + time.Now().Format("2006-01-02")
if report.Title != expected {
t.Fatalf("expected titleprefix to be '%s', got '%s'", expected, report.Title)
}
if report.Format != "html" {
t.Fatal("expected format to be set")
Expand Down

0 comments on commit da46f7d

Please sign in to comment.