Compare commits
No commits in common. "master" and "develop" have entirely different histories.
@ -5,13 +5,14 @@
|
|||||||
package goes
|
package goes
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "gopkg.in/check.v1"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
. "github.com/go-check/check"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -40,7 +41,7 @@ func (s *GoesTestSuite) SetUpTest(c *C) {
|
|||||||
|
|
||||||
func (s *GoesTestSuite) TestNewClient(c *C) {
|
func (s *GoesTestSuite) TestNewClient(c *C) {
|
||||||
conn := NewClient(ESHost, ESPort)
|
conn := NewClient(ESHost, ESPort)
|
||||||
c.Assert(conn, DeepEquals, &Client{ESHost, ESPort, http.DefaultClient, "", "", ""})
|
c.Assert(conn, DeepEquals, &Client{ESHost, ESPort, http.DefaultClient, ""})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *GoesTestSuite) TestWithHTTPClient(c *C) {
|
func (s *GoesTestSuite) TestWithHTTPClient(c *C) {
|
||||||
@ -53,7 +54,7 @@ func (s *GoesTestSuite) TestWithHTTPClient(c *C) {
|
|||||||
}
|
}
|
||||||
conn := NewClient(ESHost, ESPort).WithHTTPClient(cl)
|
conn := NewClient(ESHost, ESPort).WithHTTPClient(cl)
|
||||||
|
|
||||||
c.Assert(conn, DeepEquals, &Client{ESHost, ESPort, cl, "", "", ""})
|
c.Assert(conn, DeepEquals, &Client{ESHost, ESPort, cl, ""})
|
||||||
c.Assert(conn.Client.Transport.(*http.Transport).DisableCompression, Equals, true)
|
c.Assert(conn.Client.Transport.(*http.Transport).DisableCompression, Equals, true)
|
||||||
c.Assert(conn.Client.Transport.(*http.Transport).ResponseHeaderTimeout, Equals, 1*time.Second)
|
c.Assert(conn.Client.Transport.(*http.Transport).ResponseHeaderTimeout, Equals, 1*time.Second)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user