mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-19 00:27:06 +00:00
GODT-35: New pmapi client and manager using resty
This commit is contained in:
@ -18,6 +18,7 @@
|
||||
package pmapi
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"testing"
|
||||
@ -197,15 +198,12 @@ func TestMessage_LabelMessages_NoPaging(t *testing.T) {
|
||||
}
|
||||
|
||||
// There should be enough IDs to produce just one page so the endpoint should be called once.
|
||||
finish, c := newTestServerCallbacks(t,
|
||||
finish, c := newTestClientCallbacks(t,
|
||||
routeLabelMessages,
|
||||
)
|
||||
defer finish()
|
||||
|
||||
c.uid = testUID
|
||||
c.accessToken = testAccessToken
|
||||
|
||||
assert.NoError(t, c.LabelMessages(testIDs, "mylabel"))
|
||||
assert.NoError(t, c.LabelMessages(context.TODO(), testIDs, "mylabel"))
|
||||
}
|
||||
|
||||
func TestMessage_LabelMessages_Paging(t *testing.T) {
|
||||
@ -216,15 +214,12 @@ func TestMessage_LabelMessages_Paging(t *testing.T) {
|
||||
}
|
||||
|
||||
// There should be enough IDs to produce three pages so the endpoint should be called three times.
|
||||
finish, c := newTestServerCallbacks(t,
|
||||
finish, c := newTestClientCallbacks(t,
|
||||
routeLabelMessages,
|
||||
routeLabelMessages,
|
||||
routeLabelMessages,
|
||||
)
|
||||
defer finish()
|
||||
|
||||
c.uid = testUID
|
||||
c.accessToken = testAccessToken
|
||||
|
||||
assert.NoError(t, c.LabelMessages(testIDs, "mylabel"))
|
||||
assert.NoError(t, c.LabelMessages(context.TODO(), testIDs, "mylabel"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user