client_test.go 719 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package client
  2. import (
  3. "context"
  4. "testing"
  5. "time"
  6. . "github.com/smartystreets/goconvey/convey"
  7. )
  8. var (
  9. s *Service
  10. )
  11. func startRPCServer() {
  12. s = New(nil)
  13. }
  14. func TestClient_DelTokenCache(t *testing.T) {
  15. startRPCServer()
  16. time.Sleep(3 * time.Second)
  17. Convey("Test RPC client del token by token", t, func() {
  18. var (
  19. c = context.TODO()
  20. ak = "64294c76972aee8cf4af51566c76ed0d"
  21. )
  22. err := s.DelTokenCache(c, ak)
  23. So(err, ShouldBeNil)
  24. })
  25. }
  26. func TestClient_DelCookieCookie(t *testing.T) {
  27. startRPCServer()
  28. time.Sleep(3 * time.Second)
  29. Convey("Test RPC Client del cookie by cookie", t, func() {
  30. sd := "1d0fb9cf,1,7f9745b6"
  31. err := s.DelCookieCookie(context.TODO(), sd)
  32. So(err, ShouldBeNil)
  33. })
  34. }