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



##########
File path: traffic_ops/traffic_ops_golang/region/regions_test.go
##########
@@ -109,3 +108,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()))
+
+       if len(errs) > 0 {
+               t.Errorf(`expected no errors,  got %v`, errs)

Review comment:
       This expects no errors because you provided `DivisionName`, but the 
validation requires `Division` *and* `DivisionName` as it's currently written. 
Which is why the test fails.




----------------------------------------------------------------
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:
[email protected]


Reply via email to