mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
22 lines
451 B
Go
22 lines
451 B
Go
package oauth1
|
|
|
|
import (
|
|
"net/http"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"golang.org/x/net/context"
|
|
)
|
|
|
|
func TestContextTransport(t *testing.T) {
|
|
client := &http.Client{
|
|
Transport: http.DefaultTransport,
|
|
}
|
|
ctx := context.WithValue(NoContext, HTTPClient, client)
|
|
assert.Equal(t, http.DefaultTransport, contextTransport(ctx))
|
|
}
|
|
|
|
func TestContextTransport_NoContextClient(t *testing.T) {
|
|
assert.Nil(t, contextTransport(NoContext))
|
|
}
|