Esempio n. 1
0
func TestEchoWrongVal(t *testing.T) {
	c, ts := clientFor(newMockAPIServer(t, mockTestEchoWrongVal()))
	defer ts.Close()

	err := c.TestEcho()
	require.Error(t, err)
}
Esempio n. 2
0
func TestWaitForAllJobsTimeout(t *testing.T) {
	c, ts := clientFor(newMockAPIServer(t, []mockAPIResponse{}))
	defer ts.Close()

	err := c.WaitForAllJobs(0, 1*time.Second, 1*time.Nanosecond)
	require.Error(t, err)
}
Esempio n. 3
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)
}
Esempio n. 4
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)
}