Unit Test added to Placement Constraints Custom Labels

This commit is contained in:
João Vitor Paes de Barros do Carmo
2018-07-04 17:35:56 -04:00
parent e2ed3a95b7
commit e9dab2781a
2 changed files with 34 additions and 15 deletions
+15
View File
@@ -382,3 +382,18 @@ func TestCheckLabelsPorts(t *testing.T) {
}
}
func TestCheckPlacementCustomLabels(t *testing.T) {
placement := types.Placement{
Constraints: []string{"node.labels.something == anything"},
}
output := loadV3Placement(placement.Constraints)
expected := map[string]string{"something": "anything"}
if output["something"] != expected["something"] {
t.Errorf("Expected %s, got %s", expected, output)
}
}