Skip to content

Commit b0f02fa

Browse files
nejchJohnVillalovos
authored andcommitted
test(api): add tests for HEAD method
1 parent 90635a7 commit b0f02fa

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/unit/test_gitlab_http_methods.py

+16
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,22 @@ def test_get_request_invalid_data(gl):
423423
assert responses.assert_call_count(url, 1) is True
424424

425425

426+
@responses.activate
427+
def test_head_request(gl):
428+
url = "http://localhost/api/v4/projects"
429+
responses.add(
430+
method=responses.HEAD,
431+
url=url,
432+
headers={"X-Total": "1"},
433+
status=200,
434+
match=helpers.MATCH_EMPTY_QUERY_PARAMS,
435+
)
436+
437+
result = gl.http_head("/projects")
438+
assert isinstance(result, requests.structures.CaseInsensitiveDict)
439+
assert result["X-Total"] == "1"
440+
441+
426442
@responses.activate
427443
def test_list_request(gl):
428444
url = "http://localhost/api/v4/projects"

0 commit comments

Comments
 (0)