Add RESTClient Custom metrics empty test

Add testing for a previously untested path, which is tested when getting
resource metrics.
This commit is contained in:
mattjmcnaughton 2018-01-05 08:40:24 -05:00
parent 411881803f
commit eb688e098f

View File

@ -249,6 +249,16 @@ func TestRESTClientQpsSumEqualZero(t *testing.T) {
tc.runTest(t) tc.runTest(t)
} }
func TestRESTClientQpsEmptyMetrics(t *testing.T) {
tc := restClientTestCase{
metricName: "qps",
desiredError: fmt.Errorf("no metrics returned from custom metrics API"),
reportedMetricPoints: []metricPoint{},
}
tc.runTest(t)
}
func TestRESTClientCPUEmptyMetrics(t *testing.T) { func TestRESTClientCPUEmptyMetrics(t *testing.T) {
tc := restClientTestCase{ tc := restClientTestCase{
resourceName: v1.ResourceCPU, resourceName: v1.ResourceCPU,