conf_svr_test.go 939 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package service
  2. import (
  3. "context"
  4. "testing"
  5. . "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestService_Push(t *testing.T) {
  8. svr := svr(t)
  9. Convey("should push", t, func() {
  10. err := svr.Push(context.Background(), 2888, "dev", "sh001", "server-1", 1)
  11. So(err, ShouldBeNil)
  12. })
  13. }
  14. func TestService_SetToken(t *testing.T) {
  15. svr := svr(t)
  16. Convey("should set token", t, func() {
  17. err := svr.SetToken(context.Background(), 2888, "dev", "sh001", "84c0c277f13111e79d54522233017188")
  18. So(err, ShouldBeNil)
  19. })
  20. }
  21. func TestService_Hosts(t *testing.T) {
  22. svr := svr(t)
  23. Convey("should get hosts", t, func() {
  24. _, err := svr.Hosts(context.Background(), 2888, "main.common-arch.msm-service", "dev", "sh001")
  25. So(err, ShouldBeNil)
  26. })
  27. }
  28. func TestService_ClearHost(t *testing.T) {
  29. svr := svr(t)
  30. Convey("should clear host", t, func() {
  31. err := svr.ClearHost(context.Background(), 2888, "dev", "sh001")
  32. So(err, ShouldBeNil)
  33. })
  34. }