示例#1
0
func TestWaitForJobTimeout(t *testing.T) {
	c, ts := clientFor(newMockAPIServer(t, []mockAPIResponse{}))
	defer ts.Close()

	ok, err := c.WaitForJob(0, 0, 1*time.Second, 1*time.Nanosecond)
	require.Error(t, err)
	require.False(t, ok)
}
示例#2
0
func TestWaitForJobMultiJobs(t *testing.T) {
	c, ts := clientFor(newMockAPIServer(t, mockWaitforJobMultiJobs()))
	defer ts.Close()

	ok, err := c.WaitForJob(1139016, 25088076, 1*time.Nanosecond, 1*time.Second)
	require.Error(t, err)
	require.False(t, ok)
}