start_test.go 440 B

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