MylesBock commented on a change in pull request #5314:
URL: https://github.com/apache/trafficcontrol/pull/5314#discussion_r529785701
##########
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:
What is the intended functionality here for this validation? Should both
Division and DivisionName be required?
----------------------------------------------------------------
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]