File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -1061,6 +1061,8 @@ def http_put(
10611061 raw = raw ,
10621062 ** kwargs ,
10631063 )
1064+ if result .status_code in gitlab .const .NO_JSON_RESPONSE_CODES :
1065+ return result
10641066 try :
10651067 json_result = result .json ()
10661068 if TYPE_CHECKING :
Original file line number Diff line number Diff line change @@ -766,6 +766,21 @@ def test_put_request_404(gl):
766766 assert responses .assert_call_count (url , 1 ) is True
767767
768768
769+ @responses .activate
770+ def test_put_request_204 (gl ):
771+ url = "http://localhost/api/v4/projects"
772+ responses .add (
773+ method = responses .PUT ,
774+ url = url ,
775+ status = 204 ,
776+ match = helpers .MATCH_EMPTY_QUERY_PARAMS ,
777+ )
778+
779+ result = gl .http_put ("/projects" )
780+ assert isinstance (result , requests .Response )
781+ assert responses .assert_call_count (url , 1 ) is True
782+
783+
769784@responses .activate
770785def test_put_request_invalid_data (gl ):
771786 url = "http://localhost/api/v4/projects"
You can’t perform that action at this time.
0 commit comments