You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2020/11/20 09:10:28 UTC

[GitHub] [trafficcontrol] MylesBock commented on a change in pull request #5314: Improve validation error message for regions with no division name

MylesBock commented on a change in pull request #5314:
URL: https://github.com/apache/trafficcontrol/pull/5314#discussion_r527550407



##########
File path: traffic_ops/traffic_ops_golang/region/regions_test.go
##########
@@ -109,3 +109,30 @@ func TestInterfaces(t *testing.T) {
 		t.Errorf("Region must be Identifier")
 	}
 }
+func TestValidation(t *testing.T) {
+	testRegion := tc.Region{
+		DivisionName: "west",
+		ID:           1,
+		Name:         "region1",
+		LastUpdated:  tc.TimeNoMod{Time: time.Now()},
+	}
+	testTORegion := TORegion{Region: testRegion}
+	errs := test.SortErrors(test.SplitErrors(testTORegion.Validate()))
+	expected := []error{}
+
+	if reflect.DeepEqual(expected, errs) {

Review comment:
       copypasted test, will update it as it seemed weird where i grabbed it from (`divisions_test.go`)




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org