MCPcopy Index your code
hub / github.com/cli/cli / TestRebuildContainerFull

Function TestRebuildContainerFull

internal/codespaces/rpc/invoker_test.go:200–222  ·  view source on GitHub ↗

Test that the RPC invoker doesn't throw an error when requesting a full rebuild

(t *testing.T)

Source from the content-addressed store, hash-verified

198
199// Test that the RPC invoker doesn't throw an error when requesting a full rebuild
200func TestRebuildContainerFull(t *testing.T) {
201 resp := codespace.RebuildContainerResponse{
202 RebuildContainer: true,
203 }
204
205 server := newMockServer()
206 server.RebuildContainerAsyncFunc = func(context.Context, *codespace.RebuildContainerRequest) (*codespace.RebuildContainerResponse, error) {
207 return &resp, nil
208 }
209
210 invoker, stop, err := createTestInvoker(t, server)
211 if err != nil {
212 t.Fatalf("error connecting to internal server: %v", err)
213 }
214 defer stop()
215
216 err = invoker.RebuildContainer(context.Background(), true)
217 if err != nil {
218 t.Fatalf("expected %v, got %v", nil, err)
219 }
220
221 verifyNotifyCodespaceOfClientActivity(t, server)
222}
223
224// Test that the RPC invoker throws an error when the rebuild fails
225func TestRebuildContainerFailure(t *testing.T) {

Callers

nothing calls this directly

Calls 4

newMockServerFunction · 0.85
createTestInvokerFunction · 0.85
RebuildContainerMethod · 0.65

Tested by

no test coverage detected