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

Function TestRebuildContainerFull

internal/codespaces/rpc/invoker_test.go:201–223  ·  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

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