Skip to content

Commit d959188

Browse files
committed
tests: fixAddress coverage
1 parent efd5d96 commit d959188

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cli/request_test.go

+12
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ import (
88
"gopkg.in/h2non/gock.v1"
99
)
1010

11+
func TestFixAddress(t *testing.T) {
12+
assert.Equal(t, "https://example.com", fixAddress("example.com"))
13+
assert.Equal(t, "http://localhost:8000", fixAddress(":8000"))
14+
assert.Equal(t, "http://localhost:8000", fixAddress("localhost:8000"))
15+
16+
configs["test"] = &APIConfig{
17+
Base: "https://example.com",
18+
}
19+
assert.Equal(t, "https://example.com/foo", fixAddress("test/foo"))
20+
delete(configs, "test")
21+
}
22+
1123
func TestRequestPagination(t *testing.T) {
1224
defer gock.Off()
1325

0 commit comments

Comments
 (0)