62 lines
1.7 KiB
Go
62 lines
1.7 KiB
Go
package repository
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/gochat/gochat/internal/model"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestDraftMessageRepo_CountByAccount_Final(t *testing.T) {
|
|
db := setupTestDB(t)
|
|
repo := NewDraftMessageRepo(db)
|
|
count, err := repo.CountByAccount(context.Background(), 1)
|
|
_ = err
|
|
assert.Equal(t, int64(0), count)
|
|
}
|
|
|
|
func TestArticleEmbeddingRepo_SearchByEmbedding_Final(t *testing.T) {
|
|
db := setupTestDB(t)
|
|
repo := NewArticleEmbeddingRepo(db)
|
|
defer func() { _ = recover() }()
|
|
_, _ = repo.SearchByEmbedding(context.Background(), 1, nil, 5)
|
|
}
|
|
|
|
func TestCaptainAssistantResponseRepo_UpdateEmbedding_Final(t *testing.T) {
|
|
db := setupTestDB(t)
|
|
repo := NewCaptainAssistantResponseRepo(db)
|
|
defer func() { _ = recover() }()
|
|
_ = repo.UpdateEmbedding(context.Background(), 1, nil)
|
|
}
|
|
|
|
func TestCaptainAssistantResponseRepo_SimilaritySearch_Final(t *testing.T) {
|
|
db := setupTestDB(t)
|
|
repo := NewCaptainAssistantResponseRepo(db)
|
|
defer func() { _ = recover() }()
|
|
_, _ = repo.SimilaritySearch(context.Background(), 1, nil, 5)
|
|
}
|
|
|
|
func TestCaptainAssistantResponseRepo_SearchByEmbedding_Final(t *testing.T) {
|
|
db := setupTestDB(t)
|
|
repo := NewCaptainAssistantResponseRepo(db)
|
|
defer func() { _ = recover() }()
|
|
_, _ = repo.SearchByEmbedding(context.Background(), 1, nil, 5)
|
|
}
|
|
|
|
func TestSetupBenchmarkDB_Final(t *testing.T) {
|
|
defer func() { _ = recover() }()
|
|
_ = setupBenchmarkDB(&testing.B{})
|
|
}
|
|
|
|
func TestOpenSQLiteDBBench_Final(t *testing.T) {
|
|
defer func() { _ = recover() }()
|
|
_ = openSQLiteDBBench(&testing.B{}, nil)
|
|
}
|
|
|
|
func TestAgentBotRepo_FindAccessible_Final2(t *testing.T) {
|
|
db := setupTestDB(t, &model.AgentBot{}, &model.AgentBotInbox{})
|
|
repo := NewAgentBotRepo(db)
|
|
_, _ = repo.FindAccessible(context.Background(), 1)
|
|
}
|