MCPcopy Create free account
hub / github.com/buggregator/server / TestSMTPAPI_Cursor

Function TestSMTPAPI_Cursor

modules/smtp/api_test.go:55–70  ·  view source on GitHub ↗

TestSMTPAPI_Cursor verifies the cursor endpoint returns a valid RFC3339 time.

(t *testing.T)

Source from the content-addressed store, hash-verified

53
54// TestSMTPAPI_Cursor verifies the cursor endpoint returns a valid RFC3339 time.
55func TestSMTPAPI_Cursor(t *testing.T) {
56 mux, _, _ := setupAPITest(t)
57
58 r := httptest.NewRequest("GET", "/api/smtp/cursor", nil)
59 w := httptest.NewRecorder()
60 mux.ServeHTTP(w, r)
61
62 if w.Code != 200 {
63 t.Fatalf("status = %d", w.Code)
64 }
65 var resp map[string]string
66 json.NewDecoder(w.Body).Decode(&resp)
67 if _, err := time.Parse(time.RFC3339Nano, resp["cursor"]); err != nil {
68 t.Errorf("cursor %q is not valid RFC3339Nano: %v", resp["cursor"], err)
69 }
70}
71
72// TestSMTPAPI_Messages_Empty verifies an empty list when no messages exist.
73func TestSMTPAPI_Messages_Empty(t *testing.T) {

Callers

nothing calls this directly

Calls 3

setupAPITestFunction · 0.85
ServeHTTPMethod · 0.80
ParseMethod · 0.80

Tested by

no test coverage detected