violet/proxy/hybrid-transport_test.go

17 lines
371 B
Go
Raw Normal View History

2023-06-03 19:33:06 +01:00
package proxy
import (
"github.com/stretchr/testify/assert"
"net/http"
"testing"
)
func TestNewHybridTransport(t *testing.T) {
2023-08-17 14:38:00 +01:00
h := NewHybridTransport(nil)
2023-06-03 19:33:06 +01:00
req, err := http.NewRequest(http.MethodGet, "https://example.com", nil)
assert.NoError(t, err)
trip, err := h.SecureRoundTrip(req)
assert.NoError(t, err)
assert.Equal(t, http.StatusOK, trip.StatusCode)
}