config_test.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. package service
  2. import (
  3. "testing"
  4. . "github.com/smartystreets/goconvey/convey"
  5. )
  6. func TestService_ConfigsByIDs(t *testing.T) {
  7. svr := svr(t)
  8. Convey("should configs by ids", t, func() {
  9. res, err := svr.ConfigsByIDs([]int64{1, 2})
  10. So(err, ShouldBeNil)
  11. So(res, ShouldNotBeEmpty)
  12. })
  13. }
  14. func TestService_UpdateConfState(t *testing.T) {
  15. svr := svr(t)
  16. Convey("should update state", t, func() {
  17. err := svr.UpdateConfState(2)
  18. So(err, ShouldBeNil)
  19. })
  20. }
  21. func TestService_ConfigsByBuildID(t *testing.T) {
  22. svr := svr(t)
  23. Convey("should get config by build id", t, func() {
  24. res, err := svr.ConfigsByBuildID(1)
  25. So(err, ShouldBeNil)
  26. So(res, ShouldNotBeEmpty)
  27. })
  28. }
  29. func TestService_ConfigsByAppName(t *testing.T) {
  30. svr := svr(t)
  31. Convey("should get configs by app name", t, func() {
  32. res, err := svr.ConfigsByAppName("main.common-arch.msm-service", "dev", "shd", 2888, 0)
  33. So(err, ShouldBeNil)
  34. So(res, ShouldNotBeEmpty)
  35. })
  36. }
  37. func TestService_Configs(t *testing.T) {
  38. svr := svr(t)
  39. Convey("should configs", t, func() {
  40. res, err := svr.Configs("main.account.open-svr-mng", "fat1", "shd", 0, 2888)
  41. So(err, ShouldBeNil)
  42. So(res, ShouldNotBeEmpty)
  43. })
  44. }
  45. func TestService_Diff(t *testing.T) {
  46. svr := svr(t)
  47. Convey("should configs", t, func() {
  48. res, err := svr.Diff(1, 1)
  49. So(err, ShouldBeNil)
  50. So(res, ShouldNotBeEmpty)
  51. })
  52. }
  53. func TestService_Value(t *testing.T) {
  54. svr := svr(t)
  55. Convey("should configs", t, func() {
  56. res, err := svr.Value(1)
  57. So(err, ShouldBeNil)
  58. So(res, ShouldNotBeEmpty)
  59. })
  60. }