1
0
Fork 0
mirror of https://github.com/prometheus-operator/prometheus-operator.git synced 2025-04-21 03:38:43 +00:00

*: Add unit tests for ListOptions functions

This commit is contained in:
Frederic Branczyk 2017-11-30 14:44:56 +01:00
parent 2c4b284313
commit 0bad38a1fd
No known key found for this signature in database
GPG key ID: 7741A52782A90069
2 changed files with 54 additions and 0 deletions
pkg
alertmanager
prometheus

View file

@ -0,0 +1,27 @@
// Copyright 2017 The prometheus-operator 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 alertmanager
import (
"testing"
)
func TestListOptions(t *testing.T) {
expected := "app=alertmanager,alertmanager=test"
o := ListOptions("test")
if o.LabelSelector != expected {
t.Fatal("LabelSelector not computed correctly")
}
}

View file

@ -0,0 +1,27 @@
// Copyright 2017 The prometheus-operator 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 prometheus
import (
"testing"
)
func TestListOptions(t *testing.T) {
expected := "app=prometheus,prometheus=test"
o := ListOptions("test")
if o.LabelSelector != expected {
t.Fatal("LabelSelector not computed correctly")
}
}