22 lines
454 B
Go
22 lines
454 B
Go
package client
|
|
|
|
import (
|
|
"net/http"
|
|
"net/http/httptest"
|
|
)
|
|
|
|
// testServer creates a test HTTP server with the given handler
|
|
func testServer(handler http.HandlerFunc) *httptest.Server {
|
|
return httptest.NewServer(handler)
|
|
}
|
|
|
|
// newTestClient creates a client pointing to the test server
|
|
func newTestClient(serverURL string) *Client {
|
|
return NewClient(ClientConfig{
|
|
BaseURL: serverURL,
|
|
Token: "test-token",
|
|
Language: "en",
|
|
Timeout: 5,
|
|
})
|
|
}
|