From f4dd1443c89bd885f10c085768325ea0f5298657 Mon Sep 17 00:00:00 2001 From: knrt10 Date: Fri, 11 Sep 2020 14:58:33 +0530 Subject: [PATCH] rook: add convertNodeSelector function test Signed-off-by: knrt10 --- pkg/components/rook/component_test.go | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 pkg/components/rook/component_test.go diff --git a/pkg/components/rook/component_test.go b/pkg/components/rook/component_test.go new file mode 100644 index 000000000..e721582fb --- /dev/null +++ b/pkg/components/rook/component_test.go @@ -0,0 +1,34 @@ +// Copyright 2020 The Lokomotive Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package rook //nolint:testpackage + +import ( + "testing" +) + +func TestConvertNodeSelector(t *testing.T) { + m := map[string]string{ + "key1": "val1", + "key2": "val2", + "key3": "val3", + } + + expectedOutput := "key1=val1; key2=val2; key3=val3; " + actualOutput := convertNodeSelector(m) + + if expectedOutput != actualOutput { + t.Fatalf("expected: %s, got: %s", expectedOutput, actualOutput) + } +}