[chore] Add Federatingactor.Send() tests and log call (#509)

* expose testrig util functions

* add tests for federatingActor

* rename some suite vars
This commit is contained in:
tobi 2022-04-29 15:53:04 +02:00 committed by GitHub
commit d93e8ddf75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 169 additions and 26 deletions

View file

@ -30,27 +30,27 @@ import (
type FederatorStandardTestSuite struct {
suite.Suite
db db.DB
storage *kv.KVStore
typeConverter typeutils.TypeConverter
accounts map[string]*gtsmodel.Account
activities map[string]testrig.ActivityWithSignature
db db.DB
storage *kv.KVStore
tc typeutils.TypeConverter
testAccounts map[string]*gtsmodel.Account
testActivities map[string]testrig.ActivityWithSignature
}
// SetupSuite sets some variables on the suite that we can use as consts (more or less) throughout
func (suite *FederatorStandardTestSuite) SetupSuite() {
// setup standard items
suite.storage = testrig.NewTestStorage()
suite.typeConverter = testrig.NewTestTypeConverter(suite.db)
suite.accounts = testrig.NewTestAccounts()
suite.tc = testrig.NewTestTypeConverter(suite.db)
suite.testAccounts = testrig.NewTestAccounts()
}
func (suite *FederatorStandardTestSuite) SetupTest() {
testrig.InitTestConfig()
testrig.InitTestLog()
suite.db = testrig.NewTestDB()
suite.activities = testrig.NewTestActivities(suite.accounts)
testrig.StandardDBSetup(suite.db, suite.accounts)
suite.testActivities = testrig.NewTestActivities(suite.testAccounts)
testrig.StandardDBSetup(suite.db, suite.testAccounts)
}
// TearDownTest drops tables to make sure there's no data in the db