Move Spaces FromEnv into blob; Upload takes Object; drop logSpaces.
This commit is contained in:
@@ -3,7 +3,6 @@ package web
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"io"
|
||||
"mime/multipart"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
@@ -13,6 +12,7 @@ import (
|
||||
"github.com/alexedwards/scs/v2"
|
||||
|
||||
"plumber"
|
||||
"plumber/internal/blob"
|
||||
)
|
||||
|
||||
func newTestServer(t *testing.T) (*Server, *memDB, scs.Store) {
|
||||
@@ -296,10 +296,10 @@ type fakeBlob struct {
|
||||
|
||||
func (f *fakeBlob) Enabled() bool { return true }
|
||||
|
||||
func (f *fakeBlob) Upload(_ context.Context, key string, _ io.Reader, _ string, _ int64) (string, error) {
|
||||
func (f *fakeBlob) Upload(_ context.Context, obj blob.Object) (string, error) {
|
||||
f.calls++
|
||||
f.last = key
|
||||
return "https://cdn.example.com/" + key, nil
|
||||
f.last = obj.Key
|
||||
return "https://cdn.example.com/" + obj.Key, nil
|
||||
}
|
||||
|
||||
func TestProfilePageAndState(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user