Changeset View
Changeset View
Standalone View
Standalone View
swh/web/tests/api/test_apidoc.py
Show All 16 Lines | |||||
from swh.web.tests.utils import check_api_get_responses, check_html_get_response | from swh.web.tests.utils import check_api_get_responses, check_html_get_response | ||||
_httpdomain_doc = """ | _httpdomain_doc = """ | ||||
.. http:get:: /api/1/revision/(sha1_git)/ | .. http:get:: /api/1/revision/(sha1_git)/ | ||||
Get information about a revision in the archive. | Get information about a revision in the archive. | ||||
Revisions are identified by **sha1** checksums, compatible with Git commit | Revisions are identified by **sha1** checksums, compatible with Git commit | ||||
identifiers. | identifiers. | ||||
See :func:`swh.model.identifiers.revision_identifier` in our data model | See :func:`swh.model.git_objects.revision_git_object` in our data model | ||||
module for details about how they are computed. | module for details about how they are computed. | ||||
:param string sha1_git: hexadecimal representation of the revision | :param string sha1_git: hexadecimal representation of the revision | ||||
**sha1_git** identifier | **sha1_git** identifier | ||||
:reqheader Accept: the requested response content type, | :reqheader Accept: the requested response content type, | ||||
either ``application/json`` (default) or ``application/yaml`` | either ``application/json`` (default) or ``application/yaml`` | ||||
:resheader Content-Type: this depends on :http:header:`Accept` header | :resheader Content-Type: this depends on :http:header:`Accept` header | ||||
▲ Show 20 Lines • Show All 162 Lines • ▼ Show 20 Lines | def test_api_doc_parse_httpdomain(): | ||||
assert "urls" in doc_data | assert "urls" in doc_data | ||||
assert doc_data["urls"] == expected_urls | assert doc_data["urls"] == expected_urls | ||||
expected_description = ( | expected_description = ( | ||||
"Get information about a revision in the archive. " | "Get information about a revision in the archive. " | ||||
"Revisions are identified by **sha1** checksums, " | "Revisions are identified by **sha1** checksums, " | ||||
"compatible with Git commit identifiers. See " | "compatible with Git commit identifiers. See " | ||||
"**swh.model.identifiers.revision_identifier** in " | "**swh.model.git_objects.revision_git_object** in " | ||||
"our data model module for details about how they " | "our data model module for details about how they " | ||||
"are computed." | "are computed." | ||||
) | ) | ||||
assert "description" in doc_data | assert "description" in doc_data | ||||
assert doc_data["description"] == expected_description | assert doc_data["description"] == expected_description | ||||
expected_args = [ | expected_args = [ | ||||
▲ Show 20 Lines • Show All 276 Lines • Show Last 20 Lines |