| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1061,6 +1061,8 @@ def http_put( | |||
| 1061 | 1061 | raw=raw, | |
| 1062 | 1062 | **kwargs, | |
| 1063 | 1063 | ) | |
| 1064 | + if result.status_code in gitlab.const.NO_JSON_RESPONSE_CODES: | ||
| 1065 | + return result | ||
| 1064 | 1066 | try: | |
| 1065 | 1067 | json_result = result.json() | |
| 1066 | 1068 | if TYPE_CHECKING: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -766,6 +766,21 @@ def test_put_request_404(gl): | |||
| 766 | 766 | assert responses.assert_call_count(url, 1) is True | |
| 767 | 767 | ||
| 768 | 768 | ||
| 769 | + @responses.activate | ||
| 770 | + def test_patch_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 | + | ||
| 769 | 784 | @responses.activate | |
| 770 | 785 | def test_put_request_invalid_data(gl): | |
| 771 | 786 | url = "http://localhost/api/v4/projects" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments