mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-09 09:07:29 -06:00
tidy a bit
This commit is contained in:
parent
27d1db7f2d
commit
a9ca7f1d55
1 changed files with 10 additions and 4 deletions
|
|
@ -212,7 +212,7 @@ func (suite *AccountTestSuite) TestAPIInitialize() {
|
||||||
|
|
||||||
r, err := router.New(suite.config, log)
|
r, err := router.New(suite.config, log)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
suite.FailNow(fmt.Sprintf("error mapping routes onto router: %s", err))
|
suite.FailNow(fmt.Sprintf("error creating router: %s", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
r.AttachMiddleware(func(c *gin.Context) {
|
r.AttachMiddleware(func(c *gin.Context) {
|
||||||
|
|
@ -229,10 +229,16 @@ func (suite *AccountTestSuite) TestAPIInitialize() {
|
||||||
})
|
})
|
||||||
|
|
||||||
acct := New(suite.config, suite.db, log)
|
acct := New(suite.config, suite.db, log)
|
||||||
acct.Route(r)
|
if err := acct.Route(r); err != nil {
|
||||||
|
suite.FailNow(fmt.Sprintf("error mapping routes onto router: %s", err))
|
||||||
|
}
|
||||||
|
|
||||||
r.Start()
|
r.Start()
|
||||||
defer r.Stop(context.Background())
|
defer func() {
|
||||||
|
if err := r.Stop(context.Background()); err != nil {
|
||||||
|
panic(fmt.Errorf("error stopping router: %s", err))
|
||||||
|
}
|
||||||
|
}()
|
||||||
time.Sleep(10 * time.Second)
|
time.Sleep(10 * time.Second)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue