mirror of
https://github.com/pushbits/server.git
synced 2025-06-01 10:12:02 +02:00
add tests for config
This commit is contained in:
parent
d39e2ea9a4
commit
e87f775b1d
11 changed files with 461 additions and 6 deletions
17
tests/mockups/dispatcher.go
Normal file
17
tests/mockups/dispatcher.go
Normal file
|
@ -0,0 +1,17 @@
|
|||
package mockups
|
||||
|
||||
import (
|
||||
"github.com/pushbits/server/internal/configuration"
|
||||
"github.com/pushbits/server/internal/dispatcher"
|
||||
)
|
||||
|
||||
// GetMatrixDispatcher creates and returns a matrix dispatcher
|
||||
func GetMatrixDispatcher(homeserver, username, password string) (*dispatcher.Dispatcher, error) {
|
||||
db, err := GetEmptyDatabase()
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return dispatcher.Create(db, homeserver, username, password, configuration.Formatting{})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue