From ce64aeb05fcfca61a4cf5030811d8d5e34a2dc10 Mon Sep 17 00:00:00 2001 From: Jakub Date: Mon, 3 May 2021 07:05:15 +0200 Subject: [PATCH] Other: avoid API jail --- pkg/pmapi/dialer_pinning_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/pmapi/dialer_pinning_test.go b/pkg/pmapi/dialer_pinning_test.go index 08be764f..d16d1424 100644 --- a/pkg/pmapi/dialer_pinning_test.go +++ b/pkg/pmapi/dialer_pinning_test.go @@ -31,7 +31,7 @@ import ( func TestTLSPinValid(t *testing.T) { called, _, cm := createClientWithPinningDialer(getRootURL()) - _, _, _ = cm.NewClientWithLogin(context.Background(), "username", "pass") //nolint + _, _ = cm.getAuthInfo(context.Background(), GetAuthInfoReq{Username: "username"}) checkTLSIssueHandler(t, 0, called) } @@ -41,7 +41,7 @@ func TestTLSPinBackup(t *testing.T) { dialer.pinChecker.trustedPins[1] = dialer.pinChecker.trustedPins[0] dialer.pinChecker.trustedPins[0] = "" - _, _, _ = cm.NewClientWithLogin(context.Background(), "username", "pass") //nolint + _, _ = cm.getAuthInfo(context.Background(), GetAuthInfoReq{Username: "username"}) checkTLSIssueHandler(t, 0, called) } @@ -53,7 +53,7 @@ func TestTLSPinInvalid(t *testing.T) { called, _, cm := createClientWithPinningDialer(ts.URL) - _, _, _ = cm.NewClientWithLogin(context.Background(), "username", "pass") //nolint + _, _ = cm.getAuthInfo(context.Background(), GetAuthInfoReq{Username: "username"}) checkTLSIssueHandler(t, 1, called) } @@ -67,8 +67,8 @@ func TestTLSPinNoMatch(t *testing.T) { dialer.pinChecker.trustedPins[i] = "testing" } - _, _, _ = cm.NewClientWithLogin(context.Background(), "username", "pass") //nolint - _, _, _ = cm.NewClientWithLogin(context.Background(), "username", "pass") //nolint + _, _ = cm.getAuthInfo(context.Background(), GetAuthInfoReq{Username: "username"}) + _, _ = cm.getAuthInfo(context.Background(), GetAuthInfoReq{Username: "username"}) // Check that it will be reported only once per session, but notified every time. r.Equal(t, 1, len(dialer.reporter.sentReports))