github.com/adoriasoft/tendermint@v0.34.0-dev1.0.20200722151356-96d84601a75a/rpc/jsonrpc/client/http_json_client_test.go (about)

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