better error message for unit test
This commit is contained in:
parent
18f531b5fb
commit
a3d9f2d094
@ -25,6 +25,7 @@ import (
|
|||||||
|
|
||||||
"github.com/google/cadvisor/info"
|
"github.com/google/cadvisor/info"
|
||||||
itest "github.com/google/cadvisor/info/test"
|
itest "github.com/google/cadvisor/info/test"
|
||||||
|
"github.com/kr/pretty"
|
||||||
)
|
)
|
||||||
|
|
||||||
func testGetJsonData(
|
func testGetJsonData(
|
||||||
@ -36,7 +37,7 @@ func testGetJsonData(
|
|||||||
return fmt.Errorf("unable to retrieve data: %v", err)
|
return fmt.Errorf("unable to retrieve data: %v", err)
|
||||||
}
|
}
|
||||||
if !reflect.DeepEqual(reply, expected) {
|
if !reflect.DeepEqual(reply, expected) {
|
||||||
return fmt.Errorf("retrieved wrong data: %+v != %+v", reply, expected)
|
return pretty.Errorf("retrieved wrong data: %# v != %# v", reply, expected)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user