2023-07-18 16:17:00 -03:00
|
|
|
package nostr
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"testing"
|
2024-09-09 13:50:56 +03:30
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
2023-07-18 16:17:00 -03:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestCount(t *testing.T) {
|
2025-03-10 02:33:47 -03:00
|
|
|
const RELAY = "wss://chorus.mikedilger.com:444"
|
2023-07-18 16:17:00 -03:00
|
|
|
|
2024-09-09 13:50:56 +03:30
|
|
|
rl := mustRelayConnect(t, RELAY)
|
2023-07-18 16:17:00 -03:00
|
|
|
defer rl.Close()
|
|
|
|
|
2024-12-17 13:31:53 -03:00
|
|
|
count, _, err := rl.Count(context.Background(), Filters{
|
2024-09-19 14:12:41 +03:30
|
|
|
{Kinds: []int{KindFollowList}, Tags: TagMap{"p": []string{"3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"}}},
|
2023-07-18 16:17:00 -03:00
|
|
|
})
|
2024-09-09 13:50:56 +03:30
|
|
|
assert.NoError(t, err)
|
|
|
|
assert.Greater(t, count, int64(0))
|
2023-07-18 16:17:00 -03:00
|
|
|
}
|