You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2016/11/28 21:23:07 UTC
[09/11] incubator-trafficcontrol git commit: update cachegroup to
support real floats returned from API
update cachegroup to support real floats returned from API
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/2d2aac92
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/2d2aac92
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/2d2aac92
Branch: refs/heads/psql-rebase
Commit: 2d2aac92ee8924b9e98352c56079f01953119ad5
Parents: 0358622
Author: David Neuman <da...@gmail.com>
Authored: Mon Nov 28 14:14:15 2016 -0700
Committer: David Neuman <da...@gmail.com>
Committed: Mon Nov 28 14:14:15 2016 -0700
----------------------------------------------------------------------
traffic_ops/client/cachegroup.go | 4 ++--
traffic_ops/client/fixtures/cachegroup.go | 4 ++--
traffic_ops/client/tests/cachegroup_test.go | 12 ++++++------
3 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/2d2aac92/traffic_ops/client/cachegroup.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/cachegroup.go b/traffic_ops/client/cachegroup.go
index 1c65c56..bb21b72 100644
--- a/traffic_ops/client/cachegroup.go
+++ b/traffic_ops/client/cachegroup.go
@@ -26,8 +26,8 @@ type CacheGroupResponse struct {
type CacheGroup struct {
Name string `json:"name"`
ShortName string `json:"shortName"`
- Latitude float64 `json:"latitude,string"`
- Longitude float64 `json:"longitude,string"`
+ Latitude float64 `json:"latitude"`
+ Longitude float64 `json:"longitude"`
ParentName string `json:"parentCachegroupName,omitempty"`
Type string `json:"typeName,omitempty"`
LastUpdated string `json:"lastUpdated,omitempty"`
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/2d2aac92/traffic_ops/client/fixtures/cachegroup.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/fixtures/cachegroup.go b/traffic_ops/client/fixtures/cachegroup.go
index e6bcfd6..ea0fd69 100644
--- a/traffic_ops/client/fixtures/cachegroup.go
+++ b/traffic_ops/client/fixtures/cachegroup.go
@@ -25,8 +25,8 @@ func Cachegroups() *client.CacheGroupResponse {
Name: "edge-philadelphia",
ShortName: "phila",
Type: "EDGE_LOC",
- Longitude: 5,
- Latitude: 55,
+ Longitude: -5.66,
+ Latitude: 55.67,
ParentName: "mid-northeast",
LastUpdated: "2014-03-28 15:23:50",
},
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/2d2aac92/traffic_ops/client/tests/cachegroup_test.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/tests/cachegroup_test.go b/traffic_ops/client/tests/cachegroup_test.go
index aa343a4..13c0372 100644
--- a/traffic_ops/client/tests/cachegroup_test.go
+++ b/traffic_ops/client/tests/cachegroup_test.go
@@ -57,16 +57,16 @@ func TestCacheGroup(t *testing.T) {
testHelper.Success(t, "Should get back \"edge-philadelphia\" for \"Name\"")
}
- if cacheGroup.Longitude != 5 {
- testHelper.Error(t, "Should get back \"5\" for \"Longitude\", got: %v", cacheGroup.Longitude)
+ if cacheGroup.Longitude != -5.66 {
+ testHelper.Error(t, "Should get back \"-5.66\" for \"Longitude\", got: %v", cacheGroup.Longitude)
} else {
- testHelper.Success(t, "Should get back \"5\" for \"Longitude\"")
+ testHelper.Success(t, "Should get back \"-5.66\" for \"Longitude\"")
}
- if cacheGroup.Latitude != 55 {
- testHelper.Error(t, "Should get back \"55\" for \"Latitude\", got: %v", cacheGroup.Latitude)
+ if cacheGroup.Latitude != 55.67 {
+ testHelper.Error(t, "Should get back \"55.67\" for \"Latitude\", got: %v", cacheGroup.Latitude)
} else {
- testHelper.Success(t, "Should get back \"55\" for \"Latitude\"")
+ testHelper.Success(t, "Should get back \"55.67\" for \"Latitude\"")
}
if cacheGroup.ParentName != "mid-northeast" {