client_test.go 535 B

12345678910111213141516171819202122232425
  1. package client
  2. import (
  3. "context"
  4. "testing"
  5. "time"
  6. "go-common/app/service/main/identify-game/model"
  7. )
  8. func TestNew(t *testing.T) {
  9. cli := New(nil)
  10. time.Sleep(2 * time.Second)
  11. if err := cli.DelCache(context.Background(), &model.CleanCacheArgs{Token: "1234567890123456789012"}); err != nil {
  12. t.FailNow()
  13. }
  14. testDelCache(t, cli)
  15. }
  16. func testDelCache(t *testing.T, cli *Client) {
  17. if err := cli.DelCache(context.Background(), &model.CleanCacheArgs{Token: "1234567890123456789012"}); err != nil {
  18. t.Errorf("%v\n", err)
  19. }
  20. }