start_test.go 480 B

123456789101112131415161718192021222324
  1. package gocaptcha
  2. import (
  3. "app.yhyue.com/moapp/jybase/go-xweb/httpsession"
  4. "app.yhyue.com/moapp/jybase/redis"
  5. "fmt"
  6. "net/http"
  7. "testing"
  8. "time"
  9. )
  10. func TestCaptcha(t *testing.T) {
  11. redis.InitRedisBySize("other=172.20.45.129:1712", 100, 30, 300)
  12. InitCaptcha()
  13. var (
  14. W http.ResponseWriter
  15. R *http.Request
  16. Session = &httpsession.Session{}
  17. )
  18. Session.SetId("001")
  19. data, code := Get(Session, W, R)
  20. fmt.Println(data, code)
  21. time.Sleep(10 * time.Second)
  22. }