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

@ -32,6 +32,7 @@ type Controller struct {
labelIDGenerator idGenerator
messageIDGenerator idGenerator
tokenGenerator idGenerator
clientManager *pmapi.ClientManager
// State controlled by test.
noInternetConnection bool
@ -52,6 +53,7 @@ func NewController(cm *pmapi.ClientManager) *Controller {
labelIDGenerator: 100, // We cannot use system label IDs.
messageIDGenerator: 0,
tokenGenerator: 1000, // No specific reason; 1000 simply feels right.
clientManager: cm,
noInternetConnection: false,
usersByUsername: map[string]*fakeUser{},