test: some work on integration tests (fake)

This commit is contained in:
James Houlahan
2020-04-09 13:49:07 +02:00
parent fec5f2d3c3
commit ed8595fa5b
6 changed files with 25 additions and 15 deletions

View File

@ -103,14 +103,13 @@ func (api *FakePMAPI) checkInternetAndRecordCall(method method, path string, req
return nil
}
// TODO: This should be sent back to the ClientManager properly!
func (api *FakePMAPI) sendAuth(auth *pmapi.Auth) {
if auth != nil {
auth.DANGEROUSLYSetUID(api.uid)
}
if api.auths != nil {
api.auths <- auth
}
go func() {
api.controller.clientManager.GetClientAuthChannel() <- pmapi.ClientAuth{
UserID: api.user.ID,
Auth: auth,
}
}()
}
func (api *FakePMAPI) setUser(username string) error {