MCPcopy
hub / github.com/cli/cli / TestRebuildContainerIncremental

Function TestRebuildContainerIncremental

internal/codespaces/rpc/invoker_test.go:175–197  ·  view source on GitHub ↗

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

(t *testing.T)

Source from the content-addressed store, hash-verified

173
174// Test that the RPC invoker doesn't throw an error when requesting an incremental rebuild
175func TestRebuildContainerIncremental(t *testing.T) {
176 resp := codespace.RebuildContainerResponse{
177 RebuildContainer: true,
178 }
179
180 server := newMockServer()
181 server.RebuildContainerAsyncFunc = func(context.Context, *codespace.RebuildContainerRequest) (*codespace.RebuildContainerResponse, error) {
182 return &resp, nil
183 }
184
185 invoker, stop, err := createTestInvoker(t, server)
186 if err != nil {
187 t.Fatalf("error connecting to internal server: %v", err)
188 }
189 defer stop()
190
191 err = invoker.RebuildContainer(context.Background(), false)
192 if err != nil {
193 t.Fatalf("expected %v, got %v", nil, err)
194 }
195
196 verifyNotifyCodespaceOfClientActivity(t, server)
197}
198
199// Test that the RPC invoker doesn't throw an error when requesting a full rebuild
200func TestRebuildContainerFull(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