Exemplo n.º 1
0
func TestWaitErr(t *testing.T) {
	mc := mock.NewClient()
	mc.Err = []error{errors.New("err")}
	if err, ok := <-Wait(mc, 0, "LM-X - Tier 1", 1024); err == nil || !ok {
		t.Errorf("expected err!=nil and ok=true, was err=%q, ok=%v", err, ok)
	}
	mc.Check(t)
}
Exemplo n.º 2
0
func fixture(t *testing.T) (*mock.Client, Tool, func()) {
	addr, teardown := fakerpc.Fixture(t)
	mc := mock.NewClient()
	tool, err := New(mc, addr, "pulse_test", "pulse_test")
	if err != nil {
		t.Skip("pulsekit/dev: skipping test: ", err)
	}
	return mc, tool, teardown
}
Exemplo n.º 3
0
func TestWaitOK(t *testing.T) {
	mc := mock.NewClient()
	mc.Err = []error{nil}
	mc.BR = []pulse.BuildResult{
		{Complete: true},
		{Complete: true},
	}
	if _, ok := <-Wait(mc, 0, "LM-X - Tier 1", 1024); ok {
		t.Error("expected ok to be false")
	}
	mc.Check(t)
}
Exemplo n.º 4
0
func (f *fixture) MockClient() *mock.Client {
	mc := mock.NewClient()
	mc.BI, mc.L, mc.BR, mc.Err = f.BI, f.L, f.BR, f.Err
	return mc
}
Exemplo n.º 5
0
func fixture() (mc *mock.Client, mcli *MockCLI, f *Flags) {
	mc = mock.NewClient()
	mcli = NewMockCLI(mc)
	f = mcli.f
	return
}