mirror of
https://github.com/interviewstreet/go-jira.git
synced 2025-08-06 22:13:02 +02:00
Killed unit test TestClient_NewRequest_InvalidJSON
This commit is contained in:
20
jira_test.go
20
jira_test.go
@ -2,7 +2,6 @@ package jira
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
@ -146,25 +145,6 @@ func TestClient_NewRequest(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestClient_NewRequest_InvalidJSON(t *testing.T) {
|
||||
c, err := NewClient(nil, testJIRAInstanceURL)
|
||||
if err != nil {
|
||||
t.Errorf("An error occured. Expected nil. Got %+v.", err)
|
||||
}
|
||||
|
||||
type T struct {
|
||||
A map[int]interface{}
|
||||
}
|
||||
_, err = c.NewRequest("GET", "/", &T{})
|
||||
|
||||
if err == nil {
|
||||
t.Error("Expected error to be returned.")
|
||||
}
|
||||
if err, ok := err.(*json.UnsupportedTypeError); !ok {
|
||||
t.Errorf("Expected a JSON error; got %+v.", err)
|
||||
}
|
||||
}
|
||||
|
||||
func testURLParseError(t *testing.T, err error) {
|
||||
if err == nil {
|
||||
t.Errorf("Expected error to be returned")
|
||||
|
Reference in New Issue
Block a user