blob: 52ab8011e0c2cd33628c896fd090796264db3ddd [file] [log] [blame]
package gophercloud
import (
"testing"
"time"
th "github.com/rackspace/gophercloud/testhelper"
)
func TestWaitFor(t *testing.T) {
err := WaitFor(0, func() (bool, error) {
time.Sleep(1 * time.Second)
return true, nil
})
if err == nil {
t.Errorf("Expected error: 'Time out in WaitFor'")
}
err = WaitFor(5, func() (bool, error) {
return true, nil
})
th.CheckNoErr(t, err)
}