mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-18 08:06:59 +00:00
Other: avoid API jail
This commit is contained in:
@ -31,7 +31,7 @@ import (
|
|||||||
func TestTLSPinValid(t *testing.T) {
|
func TestTLSPinValid(t *testing.T) {
|
||||||
called, _, cm := createClientWithPinningDialer(getRootURL())
|
called, _, cm := createClientWithPinningDialer(getRootURL())
|
||||||
|
|
||||||
_, _, _ = cm.NewClientWithLogin(context.Background(), "username", "pass") //nolint
|
_, _ = cm.getAuthInfo(context.Background(), GetAuthInfoReq{Username: "username"})
|
||||||
checkTLSIssueHandler(t, 0, called)
|
checkTLSIssueHandler(t, 0, called)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ func TestTLSPinBackup(t *testing.T) {
|
|||||||
dialer.pinChecker.trustedPins[1] = dialer.pinChecker.trustedPins[0]
|
dialer.pinChecker.trustedPins[1] = dialer.pinChecker.trustedPins[0]
|
||||||
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)
|
checkTLSIssueHandler(t, 0, called)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ func TestTLSPinInvalid(t *testing.T) {
|
|||||||
|
|
||||||
called, _, cm := createClientWithPinningDialer(ts.URL)
|
called, _, cm := createClientWithPinningDialer(ts.URL)
|
||||||
|
|
||||||
_, _, _ = cm.NewClientWithLogin(context.Background(), "username", "pass") //nolint
|
_, _ = cm.getAuthInfo(context.Background(), GetAuthInfoReq{Username: "username"})
|
||||||
checkTLSIssueHandler(t, 1, called)
|
checkTLSIssueHandler(t, 1, called)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,8 +67,8 @@ func TestTLSPinNoMatch(t *testing.T) {
|
|||||||
dialer.pinChecker.trustedPins[i] = "testing"
|
dialer.pinChecker.trustedPins[i] = "testing"
|
||||||
}
|
}
|
||||||
|
|
||||||
_, _, _ = cm.NewClientWithLogin(context.Background(), "username", "pass") //nolint
|
_, _ = cm.getAuthInfo(context.Background(), GetAuthInfoReq{Username: "username"})
|
||||||
_, _, _ = cm.NewClientWithLogin(context.Background(), "username", "pass") //nolint
|
_, _ = cm.getAuthInfo(context.Background(), GetAuthInfoReq{Username: "username"})
|
||||||
|
|
||||||
// Check that it will be reported only once per session, but notified every time.
|
// Check that it will be reported only once per session, but notified every time.
|
||||||
r.Equal(t, 1, len(dialer.reporter.sentReports))
|
r.Equal(t, 1, len(dialer.reporter.sentReports))
|
||||||
|
|||||||
Reference in New Issue
Block a user