File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -995,15 +995,19 @@ func TestSearch(t *testing.T) {
995
995
996
996
func TestUploadMedia (t * testing.T ) {
997
997
ts := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
998
- if r .URL . Path != "/api/v1/media " {
998
+ if r .Method != "POST " {
999
999
http .Error (w , http .StatusText (http .StatusNotFound ), http .StatusNotFound )
1000
1000
return
1001
1001
}
1002
- if r .Method != "POST" {
1003
- http .Error (w , http .StatusText (http .StatusNotFound ), http .StatusNotFound )
1002
+ if r .URL .Path == "/api/v1/media" {
1003
+ fmt .Fprintln (w , `{"id": 123}` )
1004
+ return
1005
+ }
1006
+ if r .URL .Path == "/api/v2/media" {
1007
+ fmt .Fprintln (w , `{"id": 123}` )
1004
1008
return
1005
1009
}
1006
- fmt . Fprintln (w , `{"id": 123}` )
1010
+ http . Error (w , http . StatusText ( http . StatusNotFound ), http . StatusNotFound )
1007
1011
}))
1008
1012
defer ts .Close ()
1009
1013
You can’t perform that action at this time.
0 commit comments