ocket8888 commented on a change in pull request #4196: TP: Provides the ability
to view all users for a given role
URL: https://github.com/apache/trafficcontrol/pull/4196#discussion_r375544547
##########
File path: traffic_ops/testing/api/v1/user_test.go
##########
@@ -292,6 +294,26 @@ func GetTestUsers(t *testing.T) {
}
}
+func GetTestAdminUsers(t *testing.T) {
+ adminUsers, _, err := TOSession.GetUsersByRole("admin")
+ if err != nil {
+ t.Errorf("cannot GET users by role: %v", err)
+ }
+ if *adminUsers[0].RoleName != "admin" {
+ t.Errorf("users get: RoleName expected %v actual %v", "admin",
*adminUsers[0].RoleName)
+ }
+}
+
+func GetTestOperationsUsers(t *testing.T) {
+ opsUsers, _, err := TOSession.GetUsersByRole("operations")
+ if err != nil {
+ t.Errorf("cannot GET users by role: %v", err)
+ }
+ if *opsUsers[0].RoleName != "operations" {
Review comment:
Same as above RE: segfault possibility.
----------------------------------------------------------------
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]
With regards,
Apache Git Services