impl image upload to imgur
This commit is contained in:
27
message/images_test.go
Normal file
27
message/images_test.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package message
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"local/truckstop/config"
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestImageUpload(t *testing.T) {
|
||||
if os.Getenv("INTEGRATION") == "" {
|
||||
t.Skip("$INTEGRATION not set")
|
||||
}
|
||||
os.Setenv("CONFIG", "../config.json")
|
||||
b, err := ioutil.ReadFile("./testdata/whatever.jpg")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := config.Refresh(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
got, err := UploadImage(b)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Log(got)
|
||||
}
|
||||
Reference in New Issue
Block a user