mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2026-01-04 14:23:16 -06:00
fix up tests, add docs
This commit is contained in:
parent
9191e967a7
commit
da8e1cdd78
33 changed files with 497 additions and 170 deletions
|
|
@ -23,6 +23,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/suite"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||
)
|
||||
|
||||
|
|
@ -42,7 +43,25 @@ func (suite *BasicTestSuite) TestGetAllStatuses() {
|
|||
s := []*gtsmodel.Status{}
|
||||
err := suite.db.GetAll(context.Background(), &s)
|
||||
suite.NoError(err)
|
||||
suite.Len(s, 12)
|
||||
suite.Len(s, 13)
|
||||
}
|
||||
|
||||
func (suite *BasicTestSuite) TestGetAllNotNull() {
|
||||
where := []db.Where{{
|
||||
Key: "domain",
|
||||
Value: nil,
|
||||
Not: true,
|
||||
}}
|
||||
|
||||
a := []*gtsmodel.Account{}
|
||||
|
||||
err := suite.db.GetWhere(context.Background(), where, &a)
|
||||
suite.NoError(err)
|
||||
suite.NotEmpty(a)
|
||||
|
||||
for _, acct := range a {
|
||||
suite.NotEmpty(acct.Domain)
|
||||
}
|
||||
}
|
||||
|
||||
func TestBasicTestSuite(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue