@@ -162,19 +162,18 @@ func TestVolumesClientCp(t *testing.T) {
162162 if err != nil {
163163 t .Fatal (err )
164164 }
165- server .Mux .HandleFunc ("/v2/apps/example-go/volumes/* " , func (w http.ResponseWriter , r * http.Request ) {
165+ server .Mux .HandleFunc ("/v2/apps/example-go/volumes/myvolume/client/ " , func (w http.ResponseWriter , r * http.Request ) {
166166 testutil .SetHeaders (w )
167- if r .URL .Path == "/v2/apps/example-go/volumes/myvolume/client/" {
168- if r .URL .RawQuery == "path=etc" {
169- fmt .Fprintf (w , `{"results":[],"count":0}` )
170- } else if r .Method == http .MethodGet {
171- fmt .Fprintf (w , `{"results":[{"name":"hello.txt","size":"4159","timestamp":"2024-06-25T22:55:16+08:00","type":"file","path":"/hello.txt"}], "count": 1}` )
172- }
173- } else if r .URL .Path == "/v2/apps/example-go/volumes/myvolume/client/hello.txt" {
174- testutil .SetHeaders (w )
175- fmt .Fprintf (w , `hello word` )
167+ if r .URL .RawQuery == "path=etc" {
168+ fmt .Fprintf (w , `{"results":[],"count":0}` )
169+ } else if r .Method == http .MethodGet {
170+ fmt .Fprintf (w , `{"results":[{"name":"hello.txt","size":"4159","timestamp":"2024-06-25T22:55:16+08:00","type":"file","path":"/hello.txt"}], "count": 1}` )
176171 }
177172 })
173+ server .Mux .HandleFunc ("/v2/apps/example-go/volumes/myvolume/client/hello.txt" , func (w http.ResponseWriter , r * http.Request ) {
174+ testutil .SetHeaders (w )
175+ fmt .Fprintf (w , `hello word` )
176+ })
178177 defer server .Close ()
179178
180179 var b bytes.Buffer
0 commit comments