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

Function TestRebuildContainerIncremental

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

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