mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-09-17 19:13:56 +02:00
using testify instead of testing.T methods. (#143)
This commit is contained in:
@@ -6,10 +6,14 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/nbd-wtf/go-nostr"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestUpload(t *testing.T) {
|
||||
img, _ := os.Open("./testdata/image.png")
|
||||
img, err := os.Open("./testdata/image.png")
|
||||
require.NoError(t, err)
|
||||
|
||||
defer img.Close()
|
||||
|
||||
ctx := context.Background()
|
||||
@@ -24,9 +28,7 @@ func TestUpload(t *testing.T) {
|
||||
ContentType: "image/png",
|
||||
NoTransform: true,
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err, "client.Upload")
|
||||
}
|
||||
assert.NoError(t, err)
|
||||
|
||||
t.Logf("resp: %#v\n", *resp)
|
||||
// nip96_test.go:28: resp: nip96.UploadResponse{Status:"success", Message:"Upload successful.", ProcessingURL:"", Nip94Event:struct { Tags nostr.Tags "json:\"tags\"" }{Tags:nostr.Tags{nostr.Tag{"url", "https://image.nostr.build/4ece05f1d77c9cb97d334ba9c0301b2960640df89bf5d75d6bffadefc4355673.jpg"}, nostr.Tag{"ox", "4ece05f1d77c9cb97d334ba9c0301b2960640df89bf5d75d6bffadefc4355673"}, nostr.Tag{"x", ""}, nostr.Tag{"m", "image/jpeg"}, nostr.Tag{"dim", "1125x750"}, nostr.Tag{"bh", "LLF=kB-;yH-;-;R#t7xKEZWA#_oM"}, nostr.Tag{"blurhash", "LLF=kB-;yH-;-;R#t7xKEZWA#_oM"}, nostr.Tag{"thumb", "https://image.nostr.build/thumb/4ece05f1d77c9cb97d334ba9c0301b2960640df89bf5d75d6bffadefc4355673.jpg"}}}}
|
||||
|
Reference in New Issue
Block a user