pehpeh API server in golang
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

19 行
432B

  1. package main
  2. import (
  3. "net/http"
  4. "net/http/httptest"
  5. "testing"
  6. "github.com/stretchr/testify/assert"
  7. )
  8. func TestConfigure(t *testing.T) {
  9. srv := Configure()
  10. request, _ := http.NewRequest("GET", "/", nil)
  11. response := httptest.NewRecorder()
  12. srv.ServeHTTP(response, request)
  13. assert.Equal(t, "pehpeh-api", response.Body.String(), "response body is expected")
  14. assert.Equal(t, 200, response.Code, "OK response is expected")
  15. }