using testify instead of testing.T methods. (#143)

This commit is contained in:
K
2024-09-09 13:50:56 +03:30
committed by GitHub
parent b2692a2584
commit c91e7b9765
21 changed files with 473 additions and 643 deletions

View File

@@ -3,24 +3,19 @@ package nostr
import (
"context"
"testing"
"github.com/stretchr/testify/assert"
)
func TestCount(t *testing.T) {
const RELAY = "wss://relay.nostr.band"
rl := mustRelayConnect(RELAY)
rl := mustRelayConnect(t, RELAY)
defer rl.Close()
count, err := rl.Count(context.Background(), Filters{
{Kinds: []int{KindContactList}, Tags: TagMap{"p": []string{"3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"}}},
})
if err != nil {
t.Errorf("count request failed: %v", err)
return
}
if count <= 0 {
t.Errorf("count result wrong: %v", count)
return
}
assert.NoError(t, err)
assert.Greater(t, count, int64(0))
}