Loosen error message matching for unit test
parent
c8f5679986
commit
02362d8d9c
1
go.mod
1
go.mod
|
@ -72,7 +72,6 @@ require (
|
|||
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456
|
||||
golang.org/x/text v0.3.2
|
||||
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 // indirect
|
||||
gotest.tools v2.2.0+incompatible
|
||||
k8s.io/api v0.17.2
|
||||
k8s.io/apimachinery v0.17.2
|
||||
k8s.io/client-go v11.0.0+incompatible
|
||||
|
|
|
@ -40,10 +40,14 @@ func TestAPIError(t *testing.T) {
|
|||
machineAPI, configLoader, machineName,
|
||||
}
|
||||
|
||||
s, r, err := inspector.getStateAndRoute()
|
||||
_, _, err := inspector.getStateAndRoute()
|
||||
if err == nil {
|
||||
t.Errorf("expected error, got nil")
|
||||
}
|
||||
|
||||
if err == nil || !strings.Contains(err.Error(), "Machine does not exist") {
|
||||
t.Errorf("cluster inspector should propagate errors from API, getStateAndRoute() returned \"%v, %v\", %v", s, r, err)
|
||||
// Make sure we properly propagate errors upward
|
||||
if !strings.Contains(err.Error(), "exist") {
|
||||
t.Errorf("getStateAndRoute error=%q, expected *exist*", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue