You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by de...@apache.org on 2018/06/05 16:18:18 UTC

[incubator-trafficcontrol] branch master updated (b8694ac -> 265405d)

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

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


    from b8694ac  Remove dead delivery service Handler code
     new 5283848  Fixed api tests for Types
     new 265405d  Fixe GO formatting

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 traffic_ops/testing/api/v13/types_test.go | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

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

[incubator-trafficcontrol] 02/02: Fixe GO formatting

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 265405dd73ba12235a1161f42267d87936737167
Author: ASchmidt <An...@comcast.com>
AuthorDate: Tue Jun 5 09:22:08 2018 -0600

    Fixe GO formatting
---
 traffic_ops/testing/api/v13/types_test.go | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/traffic_ops/testing/api/v13/types_test.go b/traffic_ops/testing/api/v13/types_test.go
index 02b379d..eae7703 100644
--- a/traffic_ops/testing/api/v13/types_test.go
+++ b/traffic_ops/testing/api/v13/types_test.go
@@ -32,7 +32,7 @@ func TestTypes(t *testing.T) {
 }
 
 func CreateTestTypes(t *testing.T) {
-        log.Debugln("---- CreateTestTypes ----")
+	log.Debugln("---- CreateTestTypes ----")
 
 	for _, typ := range testData.Types {
 		resp, _, err := TOSession.CreateType(typ)
@@ -45,7 +45,7 @@ func CreateTestTypes(t *testing.T) {
 }
 
 func UpdateTestTypes(t *testing.T) {
-        log.Debugln("---- UpdateTestTypes ----")
+	log.Debugln("---- UpdateTestTypes ----")
 
 	firstType := testData.Types[0]
 	// Retrieve the Type by name so we can get the id for the Update
@@ -74,7 +74,7 @@ func UpdateTestTypes(t *testing.T) {
 
 	log.Debugln("Response Type: ", respType)
 
-        respType.Name = firstType.Name
+	respType.Name = firstType.Name
 	alert, _, err = TOSession.UpdateTypeByID(respType.ID, respType)
 	if err != nil {
 		t.Errorf("cannot restore UPDATE Type by id: %v - %v\n", err, alert)
@@ -82,7 +82,7 @@ func UpdateTestTypes(t *testing.T) {
 }
 
 func GetTestTypes(t *testing.T) {
-        log.Debugln("---- GetTestTypes ----")
+	log.Debugln("---- GetTestTypes ----")
 
 	for _, typ := range testData.Types {
 		resp, _, err := TOSession.GetTypeByName(typ.Name)
@@ -91,12 +91,12 @@ func GetTestTypes(t *testing.T) {
 
 		}
 
-	        log.Debugln("Response: ", resp)
+		log.Debugln("Response: ", resp)
 	}
 }
 
 func DeleteTestTypes(t *testing.T) {
-        log.Debugln("---- DeleteTestTypes ----")
+	log.Debugln("---- DeleteTestTypes ----")
 
 	for _, typ := range testData.Types {
 		// Retrieve the Type by name so we can get the id for the Update

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

[incubator-trafficcontrol] 01/02: Fixed api tests for Types

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 5283848f2189401730fea8f4fd893a62dcc94c42
Author: ASchmidt <An...@comcast.com>
AuthorDate: Tue Jun 5 09:14:51 2018 -0600

    Fixed api tests for Types
---
 traffic_ops/testing/api/v13/types_test.go | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/traffic_ops/testing/api/v13/types_test.go b/traffic_ops/testing/api/v13/types_test.go
index 8d6ad92..02b379d 100644
--- a/traffic_ops/testing/api/v13/types_test.go
+++ b/traffic_ops/testing/api/v13/types_test.go
@@ -25,25 +25,27 @@ import (
 func TestTypes(t *testing.T) {
 
 	CreateTestTypes(t)
-	//UpdateTestTypes(t)
-	//GetTestTypes(t)
-	//DeleteTestTypes(t)
+	UpdateTestTypes(t)
+	GetTestTypes(t)
+	DeleteTestTypes(t)
 
 }
 
 func CreateTestTypes(t *testing.T) {
+        log.Debugln("---- CreateTestTypes ----")
 
 	for _, typ := range testData.Types {
 		resp, _, err := TOSession.CreateType(typ)
-		log.Debugln("Response: ", resp)
 		if err != nil {
 			t.Errorf("could not CREATE types: %v\n", err)
 		}
+		log.Debugln("Response: ", resp)
 	}
 
 }
 
 func UpdateTestTypes(t *testing.T) {
+        log.Debugln("---- UpdateTestTypes ----")
 
 	firstType := testData.Types[0]
 	// Retrieve the Type by name so we can get the id for the Update
@@ -70,24 +72,36 @@ func UpdateTestTypes(t *testing.T) {
 		t.Errorf("results do not match actual: %s, expected: %s\n", respType.Name, expectedTypeName)
 	}
 
+	log.Debugln("Response Type: ", respType)
+
+        respType.Name = firstType.Name
+	alert, _, err = TOSession.UpdateTypeByID(respType.ID, respType)
+	if err != nil {
+		t.Errorf("cannot restore UPDATE Type by id: %v - %v\n", err, alert)
+	}
 }
 
 func GetTestTypes(t *testing.T) {
+        log.Debugln("---- GetTestTypes ----")
 
 	for _, typ := range testData.Types {
 		resp, _, err := TOSession.GetTypeByName(typ.Name)
 		if err != nil {
 			t.Errorf("cannot GET Type by name: %v - %v\n", err, resp)
+
 		}
+
+	        log.Debugln("Response: ", resp)
 	}
 }
 
 func DeleteTestTypes(t *testing.T) {
+        log.Debugln("---- DeleteTestTypes ----")
 
 	for _, typ := range testData.Types {
 		// Retrieve the Type by name so we can get the id for the Update
 		resp, _, err := TOSession.GetTypeByName(typ.Name)
-		if err != nil {
+		if err != nil || len(resp) == 0 {
 			t.Errorf("cannot GET Type by name: %v - %v\n", typ.Name, err)
 		}
 		respType := resp[0]

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