dangogh commented on a change in pull request #3163: Fix Traffic Ops Tenancy and Activity Bugs, Fix TO API Test Framework to work with Tenancy URL: https://github.com/apache/trafficcontrol/pull/3163#discussion_r244386192
########## File path: traffic_ops/testing/api/v14/tenants_test.go ########## @@ -110,27 +114,195 @@ func DeleteTestTenants(t *testing.T) { if err != nil { t.Errorf("cannot GET Tenant by name: %v - %v\n", t1, err) } + expectedChildDeleteErrMsg := `Tenant '` + strconv.Itoa(tenant1.ID) + `' has child tenants. Please update these child tenants and retry.` + if _, err := TOSession.DeleteTenant(strconv.Itoa(tenant1.ID)); err == nil { + t.Fatalf("%s has child tenants -- should not be able to delete", t1) + } else if !strings.Contains(err.Error(), expectedChildDeleteErrMsg) { + t.Errorf("expected error: %s; got %s", expectedChildDeleteErrMsg, err.Error()) + } + + deletedTenants := map[string]struct{}{} + for { Review comment: +1 ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services