Jamie Hannaford | 2aaf1a6 | 2014-10-16 12:55:50 +0200 | [diff] [blame] | 1 | package gophercloud |
2 | |||||
3 | import ( | ||||
4 | "testing" | ||||
5 | |||||
6 | th "github.com/rackspace/gophercloud/testhelper" | ||||
7 | ) | ||||
8 | |||||
9 | func TestWaitFor(t *testing.T) { | ||||
10 | err := WaitFor(0, func() (bool, error) { | ||||
11 | return true, nil | ||||
12 | }) | ||||
13 | if err == nil { | ||||
14 | t.Errorf("Expected error: 'Time out in WaitFor'") | ||||
15 | } | ||||
16 | |||||
17 | err = WaitFor(5, func() (bool, error) { | ||||
18 | return true, nil | ||||
19 | }) | ||||
20 | th.CheckNoErr(t, err) | ||||
21 | } |