feat: upgrade oohttp and propagate changes (#461)

Part of https://github.com/ooni/probe/issues/1506
This commit is contained in:
Simone Basso 2021-09-05 21:23:47 +02:00 committed by GitHub
commit b834af83ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 95 additions and 35 deletions

View file

@ -1,6 +1,7 @@
package mocks
import (
"context"
"crypto/tls"
"errors"
"reflect"
@ -20,14 +21,14 @@ func TestTLSConnConnectionState(t *testing.T) {
}
}
func TestTLSConnHandshake(t *testing.T) {
func TestTLSConnHandshakeContext(t *testing.T) {
expected := errors.New("mocked error")
c := &TLSConn{
MockHandshake: func() error {
MockHandshakeContext: func(ctx context.Context) error {
return expected
},
}
err := c.Handshake()
err := c.HandshakeContext(context.Background())
if !errors.Is(err, expected) {
t.Fatal("not the error we expected", err)
}