Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b98fba1

Browse files
committed
tests: Remove duplicate fake client method
Signed-off-by: Stephen Finucane <[email protected]>
1 parent 2ccb47d commit b98fba1

File tree

4 files changed

+6
-16
lines changed

4 files changed

+6
-16
lines changed

pagination/testing/linked_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99

1010
"github.com/gophercloud/gophercloud/v2/pagination"
1111
th "github.com/gophercloud/gophercloud/v2/testhelper"
12+
"github.com/gophercloud/gophercloud/v2/testhelper/client"
1213
)
1314

1415
// LinkedPager sample and test cases.
@@ -48,7 +49,7 @@ func createLinked() pagination.Pager {
4849
fmt.Fprintf(w, `{ "ints": [7, 8, 9], "links": { "next": null } }`)
4950
})
5051

51-
client := createClient()
52+
client := client.ServiceClient()
5253

5354
createPage := func(r pagination.PageResult) pagination.Page {
5455
return LinkedPageResult{pagination.LinkedPageBase{PageResult: r}}

pagination/testing/marker_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99

1010
"github.com/gophercloud/gophercloud/v2/pagination"
1111
th "github.com/gophercloud/gophercloud/v2/testhelper"
12+
"github.com/gophercloud/gophercloud/v2/testhelper/client"
1213
)
1314

1415
// MarkerPager sample and test cases.
@@ -58,7 +59,7 @@ func createMarkerPaged(t *testing.T) pagination.Pager {
5859
}
5960
})
6061

61-
client := createClient()
62+
client := client.ServiceClient()
6263

6364
createPage := func(r pagination.PageResult) pagination.Page {
6465
p := MarkerPageResult{pagination.MarkerPageBase{PageResult: r}}

pagination/testing/pagination_test.go

Lines changed: 0 additions & 13 deletions
This file was deleted.

pagination/testing/single_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88

99
"github.com/gophercloud/gophercloud/v2/pagination"
1010
th "github.com/gophercloud/gophercloud/v2/testhelper"
11+
"github.com/gophercloud/gophercloud/v2/testhelper/client"
1112
)
1213

1314
// SinglePage sample and test cases.
@@ -34,7 +35,7 @@ func ExtractSingleInts(r pagination.Page) ([]int, error) {
3435

3536
func setupSinglePaged() pagination.Pager {
3637
th.SetupHTTP()
37-
client := createClient()
38+
client := client.ServiceClient()
3839

3940
th.Mux.HandleFunc("/only", func(w http.ResponseWriter, r *http.Request) {
4041
w.Header().Add("Content-Type", "application/json")

0 commit comments

Comments
 (0)