build_test.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package v2
  2. import (
  3. "testing"
  4. "github.com/smartystreets/goconvey/convey"
  5. )
  6. func TestV2BuildsByAppID(t *testing.T) {
  7. var (
  8. appID = int64(24)
  9. )
  10. convey.Convey("BuildsByAppID", t, func(ctx convey.C) {
  11. builds, err := d.BuildsByAppID(appID)
  12. ctx.Convey("Then err should be nil.builds should not be nil.", func(ctx convey.C) {
  13. ctx.So(err, convey.ShouldBeNil)
  14. ctx.So(builds, convey.ShouldNotBeNil)
  15. })
  16. })
  17. }
  18. func TestV2BuildsByAppIDs(t *testing.T) {
  19. var (
  20. appIDs = []int64{24}
  21. )
  22. convey.Convey("BuildsByAppIDs", t, func(ctx convey.C) {
  23. builds, err := d.BuildsByAppIDs(appIDs)
  24. ctx.Convey("Then err should be nil.builds should not be nil.", func(ctx convey.C) {
  25. ctx.So(err, convey.ShouldBeNil)
  26. ctx.So(builds, convey.ShouldNotBeNil)
  27. })
  28. })
  29. }
  30. func TestV2TagID(t *testing.T) {
  31. var (
  32. appID = int64(24)
  33. build = "docker-1"
  34. )
  35. convey.Convey("TagID", t, func(ctx convey.C) {
  36. tagID, err := d.TagID(appID, build)
  37. ctx.Convey("Then err should be nil.tagID should not be nil.", func(ctx convey.C) {
  38. ctx.So(err, convey.ShouldBeNil)
  39. ctx.So(tagID, convey.ShouldNotBeNil)
  40. })
  41. })
  42. }