1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-09-01 21:18:12 +02:00

rename app folder to internal.

This commit is contained in:
Henrik Hautakoski 2024-02-14 13:00:33 +01:00
parent afb90af1db
commit 9974bfe3fd
28 changed files with 23 additions and 23 deletions

View file

@ -0,0 +1,28 @@
package redis
import (
"context"
"testing"
"github.com/eosswedenorg/thalos/api"
. "github.com/eosswedenorg/thalos/api/redis"
"github.com/go-redis/redismock/v9"
"github.com/stretchr/testify/assert"
)
func TestPublisher_Write(t *testing.T) {
client, mock := redismock.NewClientMock()
pub := NewPublisher(context.Background(), client, Namespace{ChainID: "id"})
mock.MatchExpectationsInOrder(true)
mock.ExpectPublish("ship::id::test", []byte("some string")).SetVal(0)
mock.ExpectPublish("ship::id::test2", []byte("some other string")).SetVal(0)
assert.NoError(t, pub.Write(api.Channel{"test"}, []byte("some string")))
assert.NoError(t, pub.Write(api.Channel{"test2"}, []byte("some other string")))
assert.NoError(t, pub.Flush())
assert.NoError(t, mock.ExpectationsWereMet())
}