From 66544b3eef6d0089cd2afc336d4e46c69d25232e Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Wed, 29 Jun 2022 13:27:28 +0200 Subject: [PATCH] ktesting: use black box testing It makes it more obvious what calls to the ktesting API will look like in real code. --- ktesting/testinglogger_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ktesting/testinglogger_test.go b/ktesting/testinglogger_test.go index 6c7ae187..c4efa462 100644 --- a/ktesting/testinglogger_test.go +++ b/ktesting/testinglogger_test.go @@ -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) { @@ -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) } @@ -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") }