ocket8888 commented on a change in pull request #3930: Rewrite profile import
to Go
URL: https://github.com/apache/trafficcontrol/pull/3930#discussion_r331140478
##########
File path: traffic_ops/testing/api/v14/profiles_test.go
##########
@@ -159,6 +160,65 @@ func GetTestProfiles(t *testing.T) {
}
}
+func ImportProfile(t *testing.T) {
+ // Get ID of Profile to export
+ resp, _, err := TOSession.GetProfileByName(testData.Profiles[0].Name)
+ if err != nil {
+ t.Errorf("cannot GET Profile by name: %v - %v\n", err, resp)
+ }
+ profileID := resp[0].ID
Review comment:
should check the length of arrays/slices before accessing elements to avoid
segfaults
----------------------------------------------------------------
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