Changeset View
Changeset View
Standalone View
Standalone View
swh/lister/gogs/tests/test_lister.py
Show First 20 Lines • Show All 171 Lines • ▼ Show 20 Lines | ): | ||||
requests_mock.get(P3, text=p3_text, headers=p3_headers) | requests_mock.get(P3, text=p3_text, headers=p3_headers) | ||||
# lister should run without any error and extract the origins | # lister should run without any error and extract the origins | ||||
stats = lister.run() | stats = lister.run() | ||||
assert stats.pages == 3 | assert stats.pages == 3 | ||||
assert stats.origins == 6 | assert stats.origins == 6 | ||||
@pytest.mark.parametrize("http_code", [400, 500, 502]) | @pytest.mark.parametrize("http_code", [400, 500]) | ||||
def test_gogs_list_http_error( | def test_gogs_list_http_error( | ||||
swh_scheduler, requests_mock, http_code, trygogs_p1, trygogs_p3_last | swh_scheduler, requests_mock, http_code, trygogs_p1, trygogs_p3_last | ||||
): | ): | ||||
"""Test handling of some HTTP errors commonly encountered""" | """Test handling of some HTTP errors commonly encountered""" | ||||
lister = GogsLister(scheduler=swh_scheduler, url=TRY_GOGS_URL, api_token="secret") | lister = GogsLister(scheduler=swh_scheduler, url=TRY_GOGS_URL, api_token="secret") | ||||
p1_text, p1_headers, _, p1_origin_urls = trygogs_p1 | p1_text, p1_headers, _, p1_origin_urls = trygogs_p1 | ||||
▲ Show 20 Lines • Show All 142 Lines • Show Last 20 Lines |