forked from Mirrors/go-iap
Bring coverage up to 100
Remove sandbox timeout to actually cause POST to fail.
This commit is contained in:
@@ -254,13 +254,9 @@ func TestVerifySandboxReceiptFailure(t *testing.T) {
|
|||||||
s := httptest.NewServer(redirectToSandbox())
|
s := httptest.NewServer(redirectToSandbox())
|
||||||
defer s.Close()
|
defer s.Close()
|
||||||
|
|
||||||
sandboxServ := httptest.NewServer(sandboxTimeout())
|
|
||||||
defer sandboxServ.Close()
|
|
||||||
|
|
||||||
client := New()
|
client := New()
|
||||||
client.URL = s.URL
|
client.URL = s.URL
|
||||||
client.TimeOut = time.Second * 100
|
client.TimeOut = time.Second * 100
|
||||||
client.SandboxURL = sandboxServ.URL
|
|
||||||
|
|
||||||
req := IAPRequest{
|
req := IAPRequest{
|
||||||
ReceiptData: "dummy data",
|
ReceiptData: "dummy data",
|
||||||
@@ -315,12 +311,6 @@ func sandboxSuccess() http.Handler {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func sandboxTimeout() http.Handler {
|
|
||||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
||||||
// Do nothing and just dont return anything either
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
func invalidResponse() http.Handler {
|
func invalidResponse() http.Handler {
|
||||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
if "POST" == r.Method {
|
if "POST" == r.Method {
|
||||||
|
|||||||
Reference in New Issue
Block a user