Skip to content

Commit

Permalink
dealing with potential import cycle
Browse files Browse the repository at this point in the history
  • Loading branch information
Derek Dowling committed Dec 17, 2015
1 parent 7e08bb6 commit 28c960e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
11 changes: 11 additions & 0 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"testing"

"github.com/derekdowling/go-json-spec-handler"
"github.com/derekdowling/jsh-api"
. "github.com/smartystreets/goconvey/convey"
)

Expand Down Expand Up @@ -78,3 +79,13 @@ func TestResponseParsing(t *testing.T) {
})
})
}

// not a great for this, would much rather have it in test_util, but it causes an
// import cycle wit jsh-api
func testAPI() *jshapi.API {
resource := jshapi.NewMockResource("test", 1, nil)
api := jshapi.New("", nil)
api.Add(resource)

return api
}
9 changes: 0 additions & 9 deletions client/test_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,8 @@ import (
"net/url"

"github.com/derekdowling/go-json-spec-handler"
"github.com/derekdowling/jsh-api"
)

func testAPI() *jshapi.API {
resource := jshapi.NewMockResource("test", 1, nil)
api := jshapi.New("", nil)
api.Add(resource)

return api
}

func mockObjectResponse(object *jsh.Object) (*http.Response, error) {
url := &url.URL{Host: "test"}
setIDPath(url, object.Type, object.ID)
Expand Down

0 comments on commit 28c960e

Please sign in to comment.