()
| 758 | } |
| 759 | |
| 760 | func 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 | |
| 780 | func TestAPI_EditCodespacePendingOperation(t *testing.T) { |
| 781 | svr := createFakeEditPendingOpServer() |
no outgoing calls
no test coverage detected