Skip to content

Commit

Permalink
- update test for new code
Browse files Browse the repository at this point in the history
  • Loading branch information
ciroque committed Nov 27, 2023
1 parent 950d7df commit 0bdc8e6
Showing 1 changed file with 8 additions and 24 deletions.
32 changes: 8 additions & 24 deletions internal/certification/certificates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,36 +22,26 @@ const (
func TestNewCertificate(t *testing.T) {
ctx := context.Background()

certificates, err := NewCertificates(ctx, nil)

if err != nil {
t.Fatalf(`Unexpected error: %v`, err)
}
certificates := NewCertificates(ctx, nil)

if certificates == nil {
t.Fatalf(`certificates should not be nil`)
}
}

func TestCertificates_Initialize(t *testing.T) {
certificates, err := NewCertificates(context.Background(), nil)
if err != nil {
t.Fatalf(`Unexpected error: %v`, err)
}
certificates := NewCertificates(context.Background(), nil)

err = certificates.Initialize()
err := certificates.Initialize()
if err != nil {
t.Fatalf(`Unexpected error: %v`, err)
}
}

func TestCertificates_RunWithoutInitialize(t *testing.T) {
certificates, err := NewCertificates(context.Background(), nil)
if err != nil {
t.Fatalf(`Unexpected error: %v`, err)
}
certificates := NewCertificates(context.Background(), nil)

err = certificates.Run()
err := certificates.Run()
if err == nil {
t.Fatalf(`Expected error`)
}
Expand All @@ -62,12 +52,9 @@ func TestCertificates_RunWithoutInitialize(t *testing.T) {
}

func TestCertificates_EmptyCertificates(t *testing.T) {
certificates, err := NewCertificates(context.Background(), nil)
if err != nil {
t.Fatalf(`error building Certificates: %v`, err)
}
certificates := NewCertificates(context.Background(), nil)

err = certificates.Initialize()
err := certificates.Initialize()
if err != nil {
t.Fatalf(`error Initializing Certificates: %v`, err)
}
Expand All @@ -92,10 +79,7 @@ func TestCertificates_ExerciseHandlers(t *testing.T) {

k8sClient := fake.NewSimpleClientset()

certificates, err := NewCertificates(ctx, k8sClient)
if err != nil {
t.Fatalf(`error building Certificates: %v`, err)
}
certificates := NewCertificates(ctx, k8sClient)

_ = certificates.Initialize()

Expand Down

0 comments on commit 0bdc8e6

Please sign in to comment.