Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xfenix committed Sep 26, 2023
1 parent c14f8d4 commit e2ccac0
Show file tree
Hide file tree
Showing 7 changed files with 165 additions and 174 deletions.
322 changes: 159 additions & 163 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions tests/test_dict_views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# pylint: disable=redefined-outer-name, unspecified-encoding
import importlib
import typing

Expand Down Expand Up @@ -65,7 +64,8 @@ def test_remove_from_user_dict(
path_to_dict_file.write_text(fake_exc_word)
if SETTINGS.dictionaries_storage_provider == StorageProviders.FILE:
assert fake_exc_word in path_to_dict_file.read_text()
server_response = app_client.delete(
server_response = app_client.request(
"DELETE",
DICT_ENDPOINT,
json=models.UserDictionaryRequestWithWord(
user_name=fake_user_name,
Expand Down
2 changes: 0 additions & 2 deletions tests/test_misc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# pylint: disable=no-member
"""Test __main__.py."""
import importlib
import os
import runpy
Expand Down
2 changes: 0 additions & 2 deletions tests/test_spell.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"""Basic test for views."""

from whole_app import models
from whole_app.spell import SpellCheckService

Expand Down
3 changes: 1 addition & 2 deletions tests/test_various_views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
"""Basic test for views."""
import typing

from whole_app.settings import SETTINGS
Expand All @@ -11,4 +10,4 @@
def test_healthcheck_api_good(app_client: "TestClient") -> typing.Any:
server_response = app_client.get(f"{SETTINGS.api_prefix}/health/")
assert server_response.status_code == 200
assert server_response.json()["version"] == "1.0.0"
assert server_response.json()["version"] == "3.2.0"
4 changes: 2 additions & 2 deletions whole_app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class SpellCheckRequest(pydantic.BaseModel):
user_name: str | None = pydantic.Field(
None,
example="username",
regex=SETTINGS.username_regex,
pattern=SETTINGS.username_regex,
min_length=SETTINGS.username_min_length,
max_length=SETTINGS.username_max_length,
)
Expand All @@ -35,7 +35,7 @@ class SpellCheckResponse(pydantic.BaseModel):
class UserDictionaryRequest(pydantic.BaseModel):
user_name: str = pydantic.Field(
example="username",
regex=SETTINGS.username_regex,
pattern=SETTINGS.username_regex,
min_length=SETTINGS.username_min_length,
max_length=SETTINGS.username_max_length,
)
Expand Down
2 changes: 1 addition & 1 deletion whole_app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
def _warn_about_poor_lru_cache_size(
possible_value: int,
) -> int:
if possible_value < 1:
if int(possible_value) < 1:
logger.warning(
(
"You set cache size less then 1. In this case, "
Expand Down

0 comments on commit e2ccac0

Please sign in to comment.