diff options
| author | Nejc Habjan <nejc.habjan@siemens.com> | 2022-06-24 19:18:18 +0200 |
|---|---|---|
| committer | John Villalovos <john@sodarock.com> | 2022-06-25 09:30:03 -0700 |
| commit | b0f02facef2ea30f24dbfb3c52974f34823e9bba (patch) | |
| tree | 8863888d5932de1b861b0f2991490f1d221605dc /tests | |
| parent | 90635a7db3c9748745471d2282260418e31c7797 (diff) | |
| download | gitlab-b0f02facef2ea30f24dbfb3c52974f34823e9bba.tar.gz | |
test(api): add tests for HEAD method
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/unit/test_gitlab_http_methods.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/unit/test_gitlab_http_methods.py b/tests/unit/test_gitlab_http_methods.py index be5b35f..ace8e25 100644 --- a/tests/unit/test_gitlab_http_methods.py +++ b/tests/unit/test_gitlab_http_methods.py @@ -424,6 +424,22 @@ def test_get_request_invalid_data(gl): @responses.activate +def test_head_request(gl): + url = "http://localhost/api/v4/projects" + responses.add( + method=responses.HEAD, + url=url, + headers={"X-Total": "1"}, + status=200, + match=helpers.MATCH_EMPTY_QUERY_PARAMS, + ) + + result = gl.http_head("/projects") + assert isinstance(result, requests.structures.CaseInsensitiveDict) + assert result["X-Total"] == "1" + + +@responses.activate def test_list_request(gl): url = "http://localhost/api/v4/projects" responses.add( |
