helper/resource: wait should return obj
This commit is contained in:
parent
eb7c8c07c8
commit
5ae69778a1
|
@ -35,12 +35,16 @@ func TestWaitForState_timeout(t *testing.T) {
|
|||
Timeout: 1 * time.Millisecond,
|
||||
}
|
||||
|
||||
_, err := conf.WaitForState()
|
||||
obj, err := conf.WaitForState()
|
||||
|
||||
if err == nil && err.Error() != "timeout while waiting for state to become 'running'" {
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
|
||||
if obj != nil {
|
||||
t.Fatalf("should not return obj")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestWaitForState_success(t *testing.T) {
|
||||
|
@ -51,11 +55,16 @@ func TestWaitForState_success(t *testing.T) {
|
|||
Timeout: 200 * time.Second,
|
||||
}
|
||||
|
||||
_, err := conf.WaitForState()
|
||||
obj, err := conf.WaitForState()
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
|
||||
if obj == nil {
|
||||
t.Fatalf("should return obj")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestWaitForState_failure(t *testing.T) {
|
||||
|
@ -66,9 +75,13 @@ func TestWaitForState_failure(t *testing.T) {
|
|||
Timeout: 200 * time.Second,
|
||||
}
|
||||
|
||||
_, err := conf.WaitForState()
|
||||
obj, err := conf.WaitForState()
|
||||
|
||||
if err == nil && err.Error() != "failed" {
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
|
||||
if obj != nil {
|
||||
t.Fatalf("should not return obj")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue