upload_test.go 635 B

12345678910111213141516171819202122232425262728
  1. package service
  2. import (
  3. "context"
  4. "io"
  5. "testing"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestServiceUpload(t *testing.T) {
  9. convey.Convey("Upload", t, func(ctx convey.C) {
  10. var (
  11. c = context.Background()
  12. fileName = ""
  13. fileType = ""
  14. expire = int64(0)
  15. body io.Reader
  16. )
  17. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  18. location, err := s.Upload(c, fileName, fileType, expire, body)
  19. ctx.Convey("Then err should be nil.location should not be nil.", func(ctx convey.C) {
  20. ctx.So(err, convey.ShouldBeNil)
  21. ctx.So(location, convey.ShouldNotBeNil)
  22. })
  23. })
  24. })
  25. }