Skip to content

Commit 28c960e

Browse files
author
Derek Dowling
committed
dealing with potential import cycle
1 parent 7e08bb6 commit 28c960e

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

client/client_test.go

+11
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"testing"
66

77
"github.com/derekdowling/go-json-spec-handler"
8+
"github.com/derekdowling/jsh-api"
89
. "github.com/smartystreets/goconvey/convey"
910
)
1011

@@ -78,3 +79,13 @@ func TestResponseParsing(t *testing.T) {
7879
})
7980
})
8081
}
82+
83+
// not a great for this, would much rather have it in test_util, but it causes an
84+
// import cycle wit jsh-api
85+
func testAPI() *jshapi.API {
86+
resource := jshapi.NewMockResource("test", 1, nil)
87+
api := jshapi.New("", nil)
88+
api.Add(resource)
89+
90+
return api
91+
}

client/test_util.go

-9
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,8 @@ import (
66
"net/url"
77

88
"github.com/derekdowling/go-json-spec-handler"
9-
"github.com/derekdowling/jsh-api"
109
)
1110

12-
func testAPI() *jshapi.API {
13-
resource := jshapi.NewMockResource("test", 1, nil)
14-
api := jshapi.New("", nil)
15-
api.Add(resource)
16-
17-
return api
18-
}
19-
2011
func mockObjectResponse(object *jsh.Object) (*http.Response, error) {
2112
url := &url.URL{Host: "test"}
2213
setIDPath(url, object.Type, object.ID)

0 commit comments

Comments
 (0)