1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-15 17:50:49 +00:00

nfd-master: correct a mistake in unit tests

Annotations were not correctly checked when testing
mockServer.updateNodeFeatures().
This commit is contained in:
Markus Lehtonen 2019-05-08 11:08:14 +03:00
parent 7f43a3db4e
commit 470cf8dff2

View file

@ -56,6 +56,7 @@ func TestUpdateNodeFeatures(t *testing.T) {
for k, _ := range fakeFeatureLabels {
fakeFeatureLabelNames = append(fakeFeatureLabelNames, k)
}
sort.Strings(fakeFeatureLabelNames)
fakeAnnotations["feature-labels"] = strings.Join(fakeFeatureLabelNames, ",")
mockAPIHelper := new(apihelper.MockAPIHelpers)
@ -80,8 +81,8 @@ func TestUpdateNodeFeatures(t *testing.T) {
So(mockNode.Labels[labelNs+k], ShouldEqual, v)
}
So(len(mockNode.Annotations), ShouldEqual, len(fakeAnnotations))
for k, v := range fakeFeatureLabels {
So(mockNode.Labels[labelNs+k], ShouldEqual, v)
for k, v := range fakeAnnotations {
So(mockNode.Annotations[annotationNs+k], ShouldEqual, v)
}
})
})