Skip to content

Commit

Permalink
➕ Upgrading Dependencies (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcbianic committed Nov 26, 2023
2 parents b1a5034 + 93ad306 commit 939cef6
Show file tree
Hide file tree
Showing 8 changed files with 818 additions and 802 deletions.
2 changes: 1 addition & 1 deletion flask_jeroboam/openapi/builder.py
Expand Up @@ -52,7 +52,7 @@ def build_openapi(
servers = app.config.get("JEROBOAM_SERVERS", None)

# Préparation
paths: Dict[str, Union[Any, PathItem]] = {}
paths: Dict[str, Any] = {}
components: Dict[str, Dict[str, Any]] = {}
operation_ids: Set[str] = set()

Expand Down
1 change: 0 additions & 1 deletion noxfile.py
Expand Up @@ -126,7 +126,6 @@ def precommit(session: Session) -> None:
"flake8-bandit",
"flake8-bugbear",
"flake8-docstrings",
"flake8-rst-docstrings",
"isort",
"pep8-naming",
"pre-commit",
Expand Down
1,592 changes: 804 additions & 788 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pyproject.toml
Expand Up @@ -38,6 +38,7 @@ Changelog = "https://github.com/jcbianic/flask-jeroboam/releases"
Flask = "^2.1.3"
pydantic = "^1.10.2"
python = "^3.8.1"
wheel = "^0.41.3"

[tool.poetry.group.dev]
optional = true
Expand All @@ -59,7 +60,6 @@ flake8 = "^6.0.0"
flake8-bandit = ">=2.1.2"
flake8-bugbear = ">=21.9.2"
flake8-docstrings = ">=1.6.0"
flake8-rst-docstrings = ">=0.2.5"
isort = ">=5.10.1"
mypy = ">=0.930"
myst-parser = {version = ">=0.16.1"}
Expand Down Expand Up @@ -98,7 +98,7 @@ sphinx-tabs = "^3.4.1"
sphinx-copybutton = "^0.5.1"

[tool.poetry.group.workflows.dependencies]
pip = "^22.3.1"
pip = "^23.3.1"
nox = "^2022.11.21"
nox-poetry = "^1.0.2"
poetry = ">=1.2, <1.3.1"
Expand Down
4 changes: 2 additions & 2 deletions tests/app_test/apps/outbound.py
Expand Up @@ -58,7 +58,7 @@ def no_response_model():

@router.get("/response_model/infered_from_return_annotation")
def response_model_is_infered_from_return_annotation() -> SimpleModelOut:
return SimpleModelOut(**valid_outbound_data)
return SimpleModelOut(total_count=10, items=["Apple", "Banana"])


@router.get(
Expand All @@ -70,7 +70,7 @@ def configuration_over_inference() -> dict:

@router.get("/response_model/turned_off", response_model=None)
def response_model_inference_is_turned_off() -> SimpleModelOut:
return SimpleModelOut(**valid_outbound_data)
return SimpleModelOut(total_count=10, items=["Apple", "Banana"])


@router.get("/return_type/dict", response_model=SimpleModelOut)
Expand Down
6 changes: 3 additions & 3 deletions tests/test_docs/features/test_inbound.py
Expand Up @@ -56,7 +56,7 @@ def test_explicit_location_on_post(client):

def test_explicit_cookie_location_with_other_explicit(client):
"""Test the explicit location GET example."""
client.set_cookie("localhost", "username", "john")
client.set_cookie("username", "john")
response = client.get(
"/explicit_location_is_query_string_and_cookie?page=42",
)
Expand All @@ -66,7 +66,7 @@ def test_explicit_cookie_location_with_other_explicit(client):

def test_explicit_cookie_location_with_other_implicit(client):
"""Test the explicit location GET example."""
client.set_cookie("localhost", "username", "john")
client.set_cookie("username", "john")
response = client.get(
"/implicit_and_explicit?page=42",
)
Expand All @@ -76,7 +76,7 @@ def test_explicit_cookie_location_with_other_implicit(client):

def test_argument_is_required(client):
"""Test the explicit location GET example."""
client.set_cookie("localhost", "username", "john")
client.set_cookie("username", "john")
response = client.get(
"implicit_location_is_query_string",
)
Expand Down
8 changes: 4 additions & 4 deletions tests/test_inbound_handler/test_cookie_parameter.py
Expand Up @@ -19,9 +19,9 @@ def _valid(x):
@pytest.mark.parametrize(
"url,cookie_value,expected_status,expected_response",
[
("/cookie/str", b"foobar", 200, _valid("foobar")),
("/cookie/int", b"123", 200, _valid(123)),
("/cookie/int", b"not_valid_int", 400, not_a_valid_int),
("/cookie/str", "foobar", 200, _valid("foobar")),
("/cookie/int", "123", 200, _valid(123)),
("/cookie/int", "not_valid_int", 400, not_a_valid_int),
],
)
def test_get_cookie(client, url, cookie_value, expected_status, expected_response):
Expand All @@ -30,7 +30,7 @@ def test_get_cookie(client, url, cookie_value, expected_status, expected_respons
TODO: Allow Configuration of the returned Status Code.
"""
client.set_cookie("localhost", "cookie", cookie_value)
client.set_cookie("cookie", cookie_value)
response = client.get(url)
assert response.status_code == expected_status
assert response.json == expected_response
3 changes: 2 additions & 1 deletion tests/test_inbound_handler/test_warnings.py
Expand Up @@ -14,6 +14,7 @@ def test_form_param_on_get_raise_warning():
with pytest.warns(UserWarning):
app = Jeroboam(__name__)

@app.get("/form_on_get")
def form_on_get(not_allowed: str = Form(...)):
return "OK"

app.get("/form_on_get")(form_on_get)

0 comments on commit 939cef6

Please sign in to comment.