Skip to content

Commit

Permalink
ktesting: use black box testing
Browse files Browse the repository at this point in the history
It makes it more obvious what calls to the ktesting API will look like in real
code.
  • Loading branch information
pohly committed Jun 29, 2022
1 parent 7a070b4 commit 66544b3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ktesting/testinglogger_test.go
Expand Up @@ -5,13 +5,15 @@ Copyright 2020 Intel Coporation.
SPDX-License-Identifier: Apache-2.0
*/

package ktesting
package ktesting_test

import (
"bytes"
"errors"
"fmt"
"testing"

"k8s.io/klog/v2/ktesting"
)

func TestInfo(t *testing.T) {
Expand Down Expand Up @@ -104,7 +106,7 @@ func TestInfo(t *testing.T) {
for n, test := range tests {
t.Run(n, func(t *testing.T) {
var buffer logToBuf
klogr := NewLogger(&buffer, NewConfig())
klogr := ktesting.NewLogger(&buffer, ktesting.NewConfig())
for _, name := range test.names {
klogr = klogr.WithName(name)
}
Expand All @@ -125,7 +127,7 @@ func TestInfo(t *testing.T) {
}

func TestCallDepth(t *testing.T) {
logger := NewLogger(t, NewConfig())
logger := ktesting.NewLogger(t, ktesting.NewConfig())
logger.Info("hello world")
}

Expand Down

0 comments on commit 66544b3

Please sign in to comment.