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

Function createFakeEditPendingOpServer

internal/codespaces/api/api_test.go:760–778  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

758}
759
760func createFakeEditPendingOpServer() *httptest.Server {
761 return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
762 if r.Method == http.MethodPatch {
763 w.WriteHeader(http.StatusUnprocessableEntity)
764 return
765 }
766
767 if r.Method == http.MethodGet {
768 response := Codespace{
769 PendingOperation: true,
770 PendingOperationDisabledReason: "Some pending operation",
771 }
772
773 responseData, _ := json.Marshal(response)
774 fmt.Fprint(w, string(responseData))
775 return
776 }
777 }))
778}
779
780func TestAPI_EditCodespacePendingOperation(t *testing.T) {
781 svr := createFakeEditPendingOpServer()

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected