zk_test.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. package dao
  2. import (
  3. "testing"
  4. "github.com/smartystreets/goconvey/convey"
  5. )
  6. func TestDaoRacks(t *testing.T) {
  7. convey.Convey("Racks", t, func(ctx convey.C) {
  8. var (
  9. cluster = "uat"
  10. )
  11. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  12. racks, err := d.Racks(cluster)
  13. ctx.Convey("Then err should be nil.racks should not be nil.", func(ctx convey.C) {
  14. ctx.So(err, convey.ShouldBeNil)
  15. ctx.So(racks, convey.ShouldNotBeNil)
  16. })
  17. })
  18. })
  19. }
  20. func TestDaoVolumes(t *testing.T) {
  21. convey.Convey("Volumes", t, func(ctx convey.C) {
  22. var (
  23. cluster = "uat"
  24. )
  25. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  26. volumes, err := d.Volumes(cluster)
  27. ctx.Convey("Then err should be nil.volumes should not be nil.", func(ctx convey.C) {
  28. ctx.So(err, convey.ShouldBeNil)
  29. ctx.So(volumes, convey.ShouldNotBeNil)
  30. })
  31. })
  32. })
  33. }
  34. func TestDaoGroups(t *testing.T) {
  35. convey.Convey("Groups", t, func(ctx convey.C) {
  36. var (
  37. cluster = "uat"
  38. )
  39. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  40. groups, err := d.Groups(cluster)
  41. ctx.Convey("Then err should be nil.groups should not be nil.", func(ctx convey.C) {
  42. ctx.So(err, convey.ShouldBeNil)
  43. ctx.So(groups, convey.ShouldNotBeNil)
  44. })
  45. })
  46. })
  47. }