upload_test.go 939 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package http
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestHttpauthorize(t *testing.T) {
  8. convey.Convey("authorize", t, func(ctx convey.C) {
  9. var (
  10. key = ""
  11. secret = ""
  12. method = ""
  13. bucket = ""
  14. file = ""
  15. expire = int64(0)
  16. )
  17. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  18. authorization := authorize(key, secret, method, bucket, file, expire)
  19. ctx.Convey("Then authorization should not be nil.", func(ctx convey.C) {
  20. ctx.So(authorization, convey.ShouldNotBeNil)
  21. })
  22. })
  23. })
  24. }
  25. func TestHttpUpload(t *testing.T) {
  26. convey.Convey("Upload", t, func(ctx convey.C) {
  27. var (
  28. c = context.TODO()
  29. )
  30. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  31. _, err := d.Upload(c, "", "", 0, []byte{})
  32. ctx.Convey("Then authorization should not be nil.", func(ctx convey.C) {
  33. ctx.So(err, convey.ShouldNotBeNil)
  34. })
  35. })
  36. })
  37. }