default_test.go 961B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package test
  2. //
  3. //import (
  4. // _ "XT_New/routers"
  5. // "net/http"
  6. // "net/http/httptest"
  7. // "path/filepath"
  8. // "runtime"
  9. // "testing"
  10. //
  11. // "github.com/astaxie/beego"
  12. // . "github.com/smartystreets/goconvey/convey"
  13. //)
  14. //
  15. //func init() {
  16. // _, file, _, _ := runtime.Caller(1)
  17. // apppath, _ := filepath.Abs(filepath.Dir(filepath.Join(file, ".."+string(filepath.Separator))))
  18. // beego.TestBeegoInit(apppath)
  19. //}
  20. //
  21. //// TestBeego is a sample to run an endpoint test
  22. //func TestBeego(t *testing.T) {
  23. // r, _ := http.NewRequest("GET", "/", nil)
  24. // w := httptest.NewRecorder()
  25. // beego.BeeApp.Handlers.ServeHTTP(w, r)
  26. //
  27. // beego.Trace("testing", "TestBeego", "Code[%d]\n%s", w.Code, w.Body.String())
  28. //
  29. // Convey("Subject: Test Station Endpoint\n", t, func() {
  30. // Convey("Status Code Should Be 200", func() {
  31. // So(w.Code, ShouldEqual, 200)
  32. // })
  33. // Convey("The Result Should Not Be Empty", func() {
  34. // So(w.Body.Len(), ShouldBeGreaterThan, 0)
  35. // })
  36. // })
  37. //}