Clear separation of different message IDs in integration tests

This commit is contained in:
Michal Horejsek
2020-10-14 14:41:39 +02:00
parent 288ba11452
commit 43d54c8f4f
22 changed files with 261 additions and 220 deletions

View File

@ -23,7 +23,6 @@ import (
"io"
"mime/multipart"
"net/http"
"strconv"
messageUtils "github.com/ProtonMail/proton-bridge/pkg/message"
"github.com/ProtonMail/proton-bridge/pkg/pmapi"
@ -127,14 +126,6 @@ func buildMessageBody(message *pmapi.Message, body *bytes.Buffer) error {
return nil
}
func (ctl *Controller) GetMessageID(username, messageIndex string) string {
idx, err := strconv.Atoi(messageIndex)
if err != nil {
panic(fmt.Sprintf("message index %s not found", messageIndex))
}
return ctl.messageIDsByUsername[username][idx-1]
}
func (ctl *Controller) GetMessages(username, labelID string) ([]*pmapi.Message, error) {
client, ok := ctl.pmapiByUsername[username]
if !ok {