This is an automated email from the ASF dual-hosted git repository.

mitchell852 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit 7e61294097fd1afbdfa4841419c9e3b81fb4f5d3
Author: Dewayne Richardson <dewr...@apache.org>
AuthorDate: Wed Apr 11 09:18:24 2018 -0600

    updated to attach the RegionID
---
 traffic_ops/testing/api/v13/phys_locations_test.go | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/traffic_ops/testing/api/v13/phys_locations_test.go 
b/traffic_ops/testing/api/v13/phys_locations_test.go
index 67f1164..6ef1e99 100644
--- a/traffic_ops/testing/api/v13/phys_locations_test.go
+++ b/traffic_ops/testing/api/v13/phys_locations_test.go
@@ -24,6 +24,9 @@ import (
 
 func TestPhysLocations(t *testing.T) {
 
+       CreateTestCDNs(t)
+       CreateTestDivisions(t)
+       CreateTestRegions(t)
        CreateTestPhysLocations(t)
        UpdateTestPhysLocations(t)
        GetTestPhysLocations(t)
@@ -33,8 +36,18 @@ func TestPhysLocations(t *testing.T) {
 
 func CreateTestPhysLocations(t *testing.T) {
 
-       for _, cdn := range testData.PhysLocations {
-               resp, _, err := TOSession.CreatePhysLocation(cdn)
+       // Attach CDNs
+       region := testData.Regions[0]
+       resp, _, err := TOSession.GetRegionByName(region.Name)
+       if err != nil {
+               t.Errorf("cannot GET region by name: %v - %v\n", region.Name, 
err)
+       }
+       respRegion := resp[0]
+
+       for _, pl := range testData.PhysLocations {
+
+               pl.RegionID = respRegion.ID
+               resp, _, err := TOSession.CreatePhysLocation(pl)
                log.Debugln("Response: ", resp)
                if err != nil {
                        t.Errorf("could not CREATE cdns: %v\n", err)

-- 
To stop receiving notification emails like this one, please contact
mitchell...@apache.org.

Reply via email to