You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
488 B

  1. package client
  2. import (
  3. "testing"
  4. "github.com/stretchr/testify/require"
  5. )
  6. func TestHTTPClientMakeHTTPDialer(t *testing.T) {
  7. remote := []string{"https://foo-bar.com:80", "http://foo-bar.net:80", "https://user:pass@foo-bar.net:80"}
  8. for _, f := range remote {
  9. u, err := newParsedURL(f)
  10. require.NoError(t, err)
  11. dialFn, err := makeHTTPDialer(f)
  12. require.Nil(t, err)
  13. addr, err := dialFn(u.Scheme, u.GetHostWithPath())
  14. require.NoError(t, err)
  15. require.NotNil(t, addr)
  16. }
  17. }