28 lines
460 B
Go
28 lines
460 B
Go
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)
|
|
}
|