GODT-35: New pmapi client and manager using resty

This commit is contained in:
James Houlahan
2021-02-22 18:23:51 +01:00
committed by Jakub
parent 1d538e8540
commit 2284e9ede1
163 changed files with 3333 additions and 8124 deletions

View File

@ -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"))
}