mirror of
https://github.com/prometheus/prometheus
synced 2024-12-23 23:13:11 +00:00
Add a unit test for labelsToOpenAPILabelSet in notifier/notifier.go. (#7492)
This PR is about adding a unit test for labelsToOpenAPILabelSet in notifier/notifier.go. Signed-off-by: Hu Shuai <hus.fnst@cn.fujitsu.com>
This commit is contained in:
parent
72425d4e3d
commit
578f2b7974
@ -27,6 +27,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/prometheus/alertmanager/api/v2/models"
|
||||
config_util "github.com/prometheus/common/config"
|
||||
"github.com/prometheus/common/model"
|
||||
yaml "gopkg.in/yaml.v2"
|
||||
@ -556,3 +557,7 @@ func makeInputTargetGroup() *targetgroup.Group {
|
||||
Source: "testsource",
|
||||
}
|
||||
}
|
||||
|
||||
func TestLabelsToOpenAPILabelSet(t *testing.T) {
|
||||
testutil.Equals(t, models.LabelSet{"aaa": "111", "bbb": "222"}, labelsToOpenAPILabelSet(labels.Labels{{Name: "aaa", Value: "111"}, {Name: "bbb", Value: "222"}}))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user