Skip to content
Snippets Groups Projects
Commit f39838af authored by Erwan Rouchet's avatar Erwan Rouchet Committed by Bastien Abadie
Browse files

Fix distutils warnings and add bump-bot

parent 0c479d6b
No related branches found
No related tags found
1 merge request!220Fix distutils warnings and add bump-bot
Pipeline #29731 passed
......@@ -100,4 +100,4 @@ bump-python-deps:
- schedules
script:
- devops python-deps requirements.txt
- devops python-deps requirements.txt tests-requirements.txt
pytest==7.2.2
pytest-mock==3.10.0
pytest-responses==0.5.1
......@@ -4,6 +4,7 @@ from pathlib import Path
import pytest
import responses
from responses import matchers
from arkindex import ArkindexClient
from arkindex.pagination import PaginationMode
......@@ -59,7 +60,7 @@ def test_page_pagination_with_missing_data(mock_schema, monkeypatch):
responses.add(
responses.GET,
base_url,
match_querystring=True,
match=[matchers.query_param_matcher({})],
json={
"count": 9,
"number": 1,
......@@ -74,7 +75,8 @@ def test_page_pagination_with_missing_data(mock_schema, monkeypatch):
for i in range(3):
responses.add(
responses.GET,
f"{base_url}?page=2",
base_url,
match=[matchers.query_param_matcher({"page": 2})],
status=400,
json={"error": "some error happened"},
)
......@@ -82,12 +84,12 @@ def test_page_pagination_with_missing_data(mock_schema, monkeypatch):
# Page 3
responses.add(
responses.GET,
f"{base_url}?page=3",
match_querystring=True,
base_url,
match=[matchers.query_param_matcher({"page": 3})],
json={
"count": 9,
"number": 3,
"previous": f"{base_url}?page=2",
"previous": f"{base_url}?page=3",
"next": None,
"results": [7, 8, 9],
},
......@@ -123,7 +125,7 @@ def test_page_pagination_incomplete(mock_schema, monkeypatch):
responses.add(
responses.GET,
base_url,
match_querystring=True,
match=[matchers.query_param_matcher({})],
json={
"count": 9,
"number": 1,
......@@ -137,7 +139,8 @@ def test_page_pagination_incomplete(mock_schema, monkeypatch):
# Page 3 is not needed as it won't try to load it
responses.add(
responses.GET,
f"{base_url}?page=2",
base_url,
match=[matchers.query_param_matcher({"page": 2})],
status=500,
)
......@@ -160,8 +163,8 @@ def test_cursor_pagination_length(mock_schema):
responses.add(
responses.GET,
f"{base_url}?with_count=true",
match_querystring=True,
base_url,
match=[matchers.query_param_matcher({"with_count": "true"})],
json={
"count": 6,
"previous": None,
......@@ -171,8 +174,8 @@ def test_cursor_pagination_length(mock_schema):
)
responses.add(
responses.GET,
f"{base_url}?cursor=DEF",
match_querystring=True,
base_url,
match=[matchers.query_param_matcher({"cursor": "DEF"})],
json={
"count": None,
"previous": f"{base_url}?cursor=ABC",
......@@ -198,8 +201,8 @@ def test_cursor_pagination_zero_results(mock_schema):
base_url = "https://dummy.test/api/v1/process/process_id/elements/"
responses.add(
responses.GET,
f"{base_url}?with_count=true",
match_querystring=True,
base_url,
match=[matchers.query_param_matcher({"with_count": "true"})],
json={
"count": 0,
"previous": None,
......@@ -223,7 +226,8 @@ def test_cursor_pagination_len_errors(mock_schema, mocker):
base_url = "https://dummy.test/api/v1/process/process_id/elements/"
responses.add(
responses.GET,
f"{base_url}?with_count=true",
base_url,
match=[matchers.query_param_matcher({"with_count": "true"})],
status=500,
)
......@@ -244,7 +248,7 @@ def test_paginate_x_paginated(mock_schema):
responses.add(
responses.GET,
"https://dummy.test/api/v1/element/element_id/metadata/",
match_querystring=True,
match=[matchers.query_param_matcher({})],
json=["a", "b"],
)
......
......@@ -6,7 +6,4 @@ passenv = ARKINDEX_API_SCHEMA_URL
commands =
pytest {posargs}
deps =
pytest
pytest-responses
pytest-mock
deps = -rtests-requirements.txt
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment