client_test.go 734 B

12345678910111213141516171819202122232425262728293031
  1. package v1
  2. import (
  3. "context"
  4. "testing"
  5. "go-common/library/net/rpc/warden"
  6. . "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestClients_Post(t *testing.T) {
  9. var (
  10. ctx = context.Background()
  11. err error
  12. res *DelCacheReply
  13. cookies *CreateCookieReply
  14. )
  15. Convey("test delete cache", t, func() {
  16. client, _ := NewClient(&warden.ClientConfig{})
  17. res, err = client.DelCache(ctx, &DelCacheReq{Token: "24325defrf"})
  18. So(err, ShouldBeNil)
  19. So(res, ShouldNotBeNil)
  20. })
  21. Convey("test get cookie by token", t, func() {
  22. client, _ := NewClient(&warden.ClientConfig{})
  23. cookies, err = client.GetCookieByToken(ctx, &CreateCookieReq{Token: "24325defrf"})
  24. So(err, ShouldNotBeNil)
  25. So(cookies, ShouldBeNil)
  26. })
  27. }