Continue changes to allow uploads to be "pending" so a decision can be made to either upload or skip them (and ultimately, edit as well).

This commit is contained in:
2021-11-06 22:56:27 +10:30
parent e1f18b104f
commit 42fb7a2003
8 changed files with 233 additions and 68 deletions

View File

@@ -43,7 +43,7 @@ func TestSuccessfulUpload(t *testing.T) {
// we will not really be uploading it here
f, _ := os.CreateTemp("", "dautest-upload-*")
defer os.Remove(f.Name())
u := Upload{webhookURL: "https://127.0.0.1/", originalFilename: f.Name()}
u := Upload{webhookURL: "https://127.0.0.1/", OriginalFilename: f.Name()}
u.Client = &MockClient{DoFunc: DoGoodUpload}
err := u.processUpload()
if err != nil {
@@ -62,7 +62,7 @@ func TestTooBigUpload(t *testing.T) {
// we will not really be uploading it here
f, _ := os.CreateTemp("", "dautest-upload-*")
defer os.Remove(f.Name())
u := Upload{webhookURL: "https://127.0.0.1/", originalFilename: f.Name()}
u := Upload{webhookURL: "https://127.0.0.1/", OriginalFilename: f.Name()}
u.Client = &MockClient{DoFunc: DoTooBigUpload}
err := u.processUpload()
if err == nil {