ocket8888 commented on a change in pull request #3930: Rewrite profile import 
to Go
URL: https://github.com/apache/trafficcontrol/pull/3930#discussion_r331141531
 
 

 ##########
 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
+
+       // Export Profile to import
+       exportResp, _, err := TOSession.ExportProfile(profileID)
+       if err != nil {
+               t.Errorf("error exporting Profile: %v - %v\n", profileID, err)
+       }
+       if exportResp == nil {
+               t.Errorf("error exporting Profile: response nil\n")
 
 Review comment:
   This should be a `t.Fatalf` - otherwise the later access of properties will 
segfault.

----------------------------------------------------------------
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

Reply via email to