@@ -1036,14 +1036,14 @@ func TestLoadBalancerGetMetrics(t *testing.T) {
1036
1036
LoadBalancerMetricRequestsPerSecond ,
1037
1037
LoadBalancerMetricBandwidth ,
1038
1038
},
1039
- Start : mustParseTime (t , time . RFC3339 , "2017-01-01T00:00:00Z" ),
1040
- End : mustParseTime (t , time . RFC3339 , "2017-01-01T23:00:00Z" ),
1039
+ Start : mustParseTime (t , "2017-01-01T00:00:00Z" ),
1040
+ End : mustParseTime (t , "2017-01-01T23:00:00Z" ),
1041
1041
},
1042
1042
respFn : func () schema.LoadBalancerGetMetricsResponse {
1043
1043
var resp schema.LoadBalancerGetMetricsResponse
1044
1044
1045
- resp .Metrics .Start = mustParseTime (t , time . RFC3339 , "2017-01-01T00:00:00Z" )
1046
- resp .Metrics .End = mustParseTime (t , time . RFC3339 , "2017-01-01T23:00:00Z" )
1045
+ resp .Metrics .Start = mustParseTime (t , "2017-01-01T00:00:00Z" )
1046
+ resp .Metrics .End = mustParseTime (t , "2017-01-01T23:00:00Z" )
1047
1047
resp .Metrics .TimeSeries = map [string ]schema.LoadBalancerTimeSeriesVals {
1048
1048
"open_connections" : {
1049
1049
Values : []interface {}{
@@ -1080,8 +1080,8 @@ func TestLoadBalancerGetMetrics(t *testing.T) {
1080
1080
return resp
1081
1081
},
1082
1082
expected : LoadBalancerMetrics {
1083
- Start : mustParseTime (t , time . RFC3339 , "2017-01-01T00:00:00Z" ),
1084
- End : mustParseTime (t , time . RFC3339 , "2017-01-01T23:00:00Z" ),
1083
+ Start : mustParseTime (t , "2017-01-01T00:00:00Z" ),
1084
+ End : mustParseTime (t , "2017-01-01T23:00:00Z" ),
1085
1085
TimeSeries : map [string ][]LoadBalancerMetricsValue {
1086
1086
"open_connections" : {
1087
1087
{Timestamp : 1435781470.622 , Value : "42" },
@@ -1110,8 +1110,8 @@ func TestLoadBalancerGetMetrics(t *testing.T) {
1110
1110
name : "missing metrics types" ,
1111
1111
lb : & LoadBalancer {ID : 3 },
1112
1112
opts : LoadBalancerGetMetricsOpts {
1113
- Start : mustParseTime (t , time . RFC3339 , "2017-01-01T00:00:00Z" ),
1114
- End : mustParseTime (t , time . RFC3339 , "2017-01-01T23:00:00Z" ),
1113
+ Start : mustParseTime (t , "2017-01-01T00:00:00Z" ),
1114
+ End : mustParseTime (t , "2017-01-01T23:00:00Z" ),
1115
1115
},
1116
1116
expectedErr : "add query params: no metric types specified" ,
1117
1117
},
@@ -1120,7 +1120,7 @@ func TestLoadBalancerGetMetrics(t *testing.T) {
1120
1120
lb : & LoadBalancer {ID : 4 },
1121
1121
opts : LoadBalancerGetMetricsOpts {
1122
1122
Types : []LoadBalancerMetricType {LoadBalancerMetricBandwidth },
1123
- End : mustParseTime (t , time . RFC3339 , "2017-01-01T23:00:00Z" ),
1123
+ End : mustParseTime (t , "2017-01-01T23:00:00Z" ),
1124
1124
},
1125
1125
expectedErr : "add query params: no start time specified" ,
1126
1126
},
@@ -1129,7 +1129,7 @@ func TestLoadBalancerGetMetrics(t *testing.T) {
1129
1129
lb : & LoadBalancer {ID : 5 },
1130
1130
opts : LoadBalancerGetMetricsOpts {
1131
1131
Types : []LoadBalancerMetricType {LoadBalancerMetricBandwidth },
1132
- Start : mustParseTime (t , time . RFC3339 , "2017-01-01T00:00:00Z" ),
1132
+ Start : mustParseTime (t , "2017-01-01T00:00:00Z" ),
1133
1133
},
1134
1134
expectedErr : "add query params: no end time specified" ,
1135
1135
},
@@ -1138,8 +1138,8 @@ func TestLoadBalancerGetMetrics(t *testing.T) {
1138
1138
lb : & LoadBalancer {ID : 6 },
1139
1139
opts : LoadBalancerGetMetricsOpts {
1140
1140
Types : []LoadBalancerMetricType {LoadBalancerMetricBandwidth },
1141
- Start : mustParseTime (t , time . RFC3339 , "2017-01-01T00:00:00Z" ),
1142
- End : mustParseTime (t , time . RFC3339 , "2017-01-01T23:00:00Z" ),
1141
+ Start : mustParseTime (t , "2017-01-01T00:00:00Z" ),
1142
+ End : mustParseTime (t , "2017-01-01T23:00:00Z" ),
1143
1143
},
1144
1144
respStatus : http .StatusInternalServerError ,
1145
1145
expectedErr : "get metrics: hcloud: server responded with status code 500" ,
@@ -1148,8 +1148,8 @@ func TestLoadBalancerGetMetrics(t *testing.T) {
1148
1148
name : "no load balancer passed" ,
1149
1149
opts : LoadBalancerGetMetricsOpts {
1150
1150
Types : []LoadBalancerMetricType {LoadBalancerMetricBandwidth },
1151
- Start : mustParseTime (t , time . RFC3339 , "2017-01-01T00:00:00Z" ),
1152
- End : mustParseTime (t , time . RFC3339 , "2017-01-01T23:00:00Z" ),
1151
+ Start : mustParseTime (t , "2017-01-01T00:00:00Z" ),
1152
+ End : mustParseTime (t , "2017-01-01T23:00:00Z" ),
1153
1153
},
1154
1154
expectedErr : "illegal argument: load balancer is nil" ,
1155
1155
},
0 commit comments