diff --git a/gestao/tests/test_gestao.py b/gestao/tests/test_gestao.py index 911c4b4..c466b2d 100644 --- a/gestao/tests/test_gestao.py +++ b/gestao/tests/test_gestao.py @@ -2,6 +2,9 @@ from fastapi import FastAPI from httpx import AsyncClient from starlette import status +from uuid import uuid4 + +from gestao.tests.utils import generate_fake_user @pytest.mark.anyio @@ -9,3 +12,136 @@ async def test_health(client: AsyncClient, fastapi_app: FastAPI) -> None: url = fastapi_app.url_path_for("health_check") response = await client.get(url) assert response.status_code == status.HTTP_200_OK + + +@pytest.mark.anyio +async def test_get_users(client: AsyncClient, fastapi_app: FastAPI) -> None: + url = fastapi_app.url_path_for("get_users") + response = await client.get(url) + assert response.status_code == 200 + + +@pytest.mark.anyio +async def test_get_user_correct(client: AsyncClient, fastapi_app: FastAPI) -> None: + url = fastapi_app.url_path_for("create_user") + user = generate_fake_user() + await client.post(url, json=user) + + url = fastapi_app.url_path_for("get_users") + response = await client.get(url) + user_data = response.json()[0] + user_id = user_data['id'] + + url = fastapi_app.url_path_for("get_user", user_id=user_id) + response = await client.get(url) + assert response.status_code == 200 + + +@pytest.mark.anyio +async def test_get_user_incorrect(client: AsyncClient, fastapi_app: FastAPI) -> None: + url = fastapi_app.url_path_for("get_user", user_id=str(uuid4())) + response = await client.get(url) + assert response.status_code == 404 + + +@pytest.mark.anyio +async def test_create_user_correct(client: AsyncClient, fastapi_app: FastAPI) -> None: + url = fastapi_app.url_path_for("create_user") + user = generate_fake_user() + response = await client.post(url, json=user) + assert response.status_code == 200 + + +@pytest.mark.anyio +async def test_create_user_incorrect(client: AsyncClient, fastapi_app: FastAPI) -> None: + url = fastapi_app.url_path_for("create_user") + user = generate_fake_user() + user.pop('name') + response = await client.post(url, json=user) + assert response.status_code == 422 + + +@pytest.mark.anyio +async def test_update_user_correct(client: AsyncClient, fastapi_app: FastAPI) -> None: + url = fastapi_app.url_path_for("create_user") + user = generate_fake_user() + await client.post(url, json=user) + + url = fastapi_app.url_path_for("get_users") + response = await client.get(url) + user_data = response.json()[0] + user_id = user_data['id'] + user_data['name'] = 'joao' + + url = fastapi_app.url_path_for("update_user", user_id=user_id) + response = await client.put(url, json=user_data) + assert response.status_code == 200 + + +@pytest.mark.anyio +async def test_update_user_incorrect(client: AsyncClient, fastapi_app: FastAPI) -> None: + url = fastapi_app.url_path_for("update_user", user_id=str(uuid4())) + response = await client.put(url, json={}) + assert response.status_code == 404 + + +@pytest.mark.anyio +async def test_delete_user_correct(client: AsyncClient, fastapi_app: FastAPI) -> None: + url = fastapi_app.url_path_for("create_user") + user = generate_fake_user() + await client.post(url, json=user) + + url = fastapi_app.url_path_for("get_users") + response = await client.get(url) + user_data = response.json()[0] + user_id = user_data['id'] + + url = fastapi_app.url_path_for("delete_user", user_id=user_id) + response = await client.delete(url) + assert response.status_code == 200 + + +@pytest.mark.anyio +async def test_disable_user_correct(client: AsyncClient, fastapi_app: FastAPI) -> None: + url = fastapi_app.url_path_for("create_user") + user = generate_fake_user() + await client.post(url, json=user) + + url = fastapi_app.url_path_for("get_users") + response = await client.get(url) + user_data = response.json()[0] + user_id = user_data['id'] + + url = fastapi_app.url_path_for("disable_user", user_id=user_id) + response = await client.patch(url) + assert response.status_code == 200 + + +@pytest.mark.anyio +async def test_disable_user_incorrect(client: AsyncClient, fastapi_app: FastAPI) -> None: + url = fastapi_app.url_path_for("disable_user", user_id=str(uuid4())) + response = await client.patch(url) + assert response.status_code == 404 + + +@pytest.mark.anyio +async def test_enable_user_correct(client: AsyncClient, fastapi_app: FastAPI) -> None: + url = fastapi_app.url_path_for("create_user") + user = generate_fake_user() + await client.post(url, json=user) + + url = fastapi_app.url_path_for("get_users") + response = await client.get(url) + user_data = response.json()[0] + user_id = user_data['id'] + + url = fastapi_app.url_path_for("enable_user", user_id=user_id) + response = await client.patch(url) + assert response.status_code == 200 + + +@pytest.mark.anyio +async def test_enable_user_incorrect(client: AsyncClient, fastapi_app: FastAPI) -> None: + url = fastapi_app.url_path_for("enable_user", user_id=str(uuid4())) + response = await client.patch(url) + assert response.status_code == 404 diff --git a/gestao/tests/utils.py b/gestao/tests/utils.py new file mode 100644 index 0000000..ac93233 --- /dev/null +++ b/gestao/tests/utils.py @@ -0,0 +1,42 @@ +def generate_fake_user(): + from faker import Faker + + f = Faker('pt-br') + user = { + 'name': f'{f.name()}', + 'address': f'{f.address()}', + 'neighborhood': 'Gama', + 'city': f'{f.city()}', + 'state': f'{f.state()}', + 'zipcode': f'{f.postcode()}', + 'cpf': f'{f.random_number(digits=11)}', + 'rg': f'{f.random_number(digits=7)}', + 'birth_date': f'{f.date_of_birth()}', + 'place_of_birth': f'{f.city()}', + 'blood_type': 'A+', + 'gender': 'M', + 'father_name': f'{f.name()}', + 'mother_date': f'{f.name()}', + 'position': 'null', + 'occupancy': 'null', + 'admission_date': f'{f.date_of_birth()}', + 'situation': 'active', + 'phone': f'{f.phone_number()}', + 'email': f'{f.email(domain="sindpol.org.br")}', + 'marital_status': 'alone', + 'education': 'Bachelor Degree', + 'registration': f'{f.random_number(digits=10)}', + 'role': 'cop', + 'category': 'null', + 'pattern': 'null', + 'dispatcher': 'null', + 'dispatched_date': f'{f.date_of_birth()}', + 'war_name': f'{f.name()}', + 'password': 'admin', + 'rg_consignor': 'SSP', + 'rg_date': f'{f.date_of_birth()}', + 'situation_obs': 'null' + } + + return user + diff --git a/poetry.lock b/poetry.lock index 330d1bb..9a9a033 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,9 +1,10 @@ -# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.4.2 and should not be changed by hand. [[package]] name = "alembic" version = "1.12.0" description = "A database migration tool for SQLAlchemy." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -23,6 +24,7 @@ tz = ["python-dateutil"] name = "anyio" version = "3.7.1" description = "High level compatibility layer for multiple asynchronous event loop implementations" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -44,6 +46,7 @@ trio = ["trio (<0.22)"] name = "astor" version = "0.8.1" description = "Read/rewrite/write Python ASTs" +category = "dev" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" files = [ @@ -55,6 +58,7 @@ files = [ name = "asyncpg" version = "0.28.0" description = "An asyncio PostgreSQL driver" +category = "main" optional = false python-versions = ">=3.7.0" files = [ @@ -108,6 +112,7 @@ test = ["flake8 (>=5.0,<6.0)", "uvloop (>=0.15.3)"] name = "attrs" version = "23.1.0" description = "Classes Without Boilerplate" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -126,6 +131,7 @@ tests-no-zope = ["cloudpickle", "hypothesis", "mypy (>=1.1.1)", "pympler", "pyte name = "autoflake" version = "1.7.8" description = "Removes unused imports and unused variables" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -141,6 +147,7 @@ tomli = {version = ">=2.0.1", markers = "python_version < \"3.11\""} name = "bandit" version = "1.7.5" description = "Security oriented static analyser for python code." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -164,6 +171,7 @@ yaml = ["PyYAML"] name = "black" version = "22.12.0" description = "The uncompromising code formatter." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -199,6 +207,7 @@ uvloop = ["uvloop (>=0.15.2)"] name = "certifi" version = "2023.7.22" description = "Python package for providing Mozilla's CA Bundle." +category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -210,6 +219,7 @@ files = [ name = "cfgv" version = "3.4.0" description = "Validate configuration and produce human readable error messages." +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -221,6 +231,7 @@ files = [ name = "click" version = "8.1.7" description = "Composable command line interface toolkit" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -235,6 +246,7 @@ colorama = {version = "*", markers = "platform_system == \"Windows\""} name = "colorama" version = "0.4.6" description = "Cross-platform colored terminal text." +category = "main" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" files = [ @@ -246,6 +258,7 @@ files = [ name = "coverage" version = "7.3.2" description = "Code coverage measurement for Python" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -313,6 +326,7 @@ toml = ["tomli"] name = "darglint" version = "1.8.1" description = "A utility for ensuring Google-style docstrings stay up to date with the source code." +category = "dev" optional = false python-versions = ">=3.6,<4.0" files = [ @@ -324,6 +338,7 @@ files = [ name = "databases" version = "0.6.2" description = "Async database support for Python." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -348,6 +363,7 @@ sqlite = ["aiosqlite"] name = "distlib" version = "0.3.7" description = "Distribution utilities" +category = "dev" optional = false python-versions = "*" files = [ @@ -359,6 +375,7 @@ files = [ name = "docutils" version = "0.20.1" description = "Docutils -- Python Documentation Utilities" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -370,6 +387,7 @@ files = [ name = "eradicate" version = "2.3.0" description = "Removes commented-out code." +category = "dev" optional = false python-versions = "*" files = [ @@ -381,6 +399,7 @@ files = [ name = "exceptiongroup" version = "1.1.3" description = "Backport of PEP 654 (exception groups)" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -391,10 +410,26 @@ files = [ [package.extras] test = ["pytest (>=6)"] +[[package]] +name = "faker" +version = "20.1.0" +description = "Faker is a Python package that generates fake data for you." +category = "main" +optional = false +python-versions = ">=3.8" +files = [ + {file = "Faker-20.1.0-py3-none-any.whl", hash = "sha256:aeb3e26742863d1e387f9d156f1c36e14af63bf5e6f36fb39b8c27f6a903be38"}, + {file = "Faker-20.1.0.tar.gz", hash = "sha256:562a3a09c3ed3a1a7b20e13d79f904dfdfc5e740f72813ecf95e4cf71e5a2f52"}, +] + +[package.dependencies] +python-dateutil = ">=2.4" + [[package]] name = "fastapi" version = "0.100.1" description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -414,6 +449,7 @@ all = ["email-validator (>=2.0.0)", "httpx (>=0.23.0)", "itsdangerous (>=1.1.0)" name = "filelock" version = "3.12.4" description = "A platform independent file lock." +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -430,6 +466,7 @@ typing = ["typing-extensions (>=4.7.1)"] name = "flake8" version = "4.0.1" description = "the modular source code checker: pep8 pyflakes and co" +category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -446,6 +483,7 @@ pyflakes = ">=2.4.0,<2.5.0" name = "flake8-bandit" version = "3.0.0" description = "Automated security testing with bandit and flake8." +category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -463,6 +501,7 @@ pycodestyle = "*" name = "flake8-broken-line" version = "0.5.0" description = "Flake8 plugin to forbid backslashes for line breaks" +category = "dev" optional = false python-versions = ">=3.6,<4.0" files = [ @@ -477,6 +516,7 @@ flake8 = ">=3.5,<6" name = "flake8-bugbear" version = "22.12.6" description = "A plugin for flake8 finding likely bugs and design problems in your program. Contains warnings that don't belong in pyflakes and pycodestyle." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -495,6 +535,7 @@ dev = ["coverage", "hypothesis", "hypothesmith (>=0.2)", "pre-commit", "tox"] name = "flake8-commas" version = "2.1.0" description = "Flake8 lint for trailing commas." +category = "dev" optional = false python-versions = "*" files = [ @@ -509,6 +550,7 @@ flake8 = ">=2" name = "flake8-comprehensions" version = "3.14.0" description = "A flake8 plugin to help you write better list/set/dict comprehensions." +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -523,6 +565,7 @@ flake8 = ">=3.0,<3.2.0 || >3.2.0" name = "flake8-debugger" version = "4.1.2" description = "ipdb/pdb statement checker plugin for flake8" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -538,6 +581,7 @@ pycodestyle = "*" name = "flake8-docstrings" version = "1.7.0" description = "Extension for flake8 which uses pydocstyle to check docstrings" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -553,6 +597,7 @@ pydocstyle = ">=2.1" name = "flake8-eradicate" version = "1.4.0" description = "Flake8 plugin to find commented out code" +category = "dev" optional = false python-versions = ">=3.7,<4.0" files = [ @@ -569,6 +614,7 @@ flake8 = ">=3.5,<6" name = "flake8-isort" version = "4.2.0" description = "flake8 plugin that integrates isort ." +category = "dev" optional = false python-versions = "*" files = [ @@ -587,6 +633,7 @@ test = ["pytest-cov"] name = "flake8-polyfill" version = "1.0.2" description = "Polyfill package for Flake8 plugins" +category = "dev" optional = false python-versions = "*" files = [ @@ -601,6 +648,7 @@ flake8 = "*" name = "flake8-quotes" version = "3.3.2" description = "Flake8 lint for quotes." +category = "dev" optional = false python-versions = "*" files = [ @@ -614,6 +662,7 @@ flake8 = "*" name = "flake8-rst-docstrings" version = "0.2.7" description = "Python docstring reStructuredText (RST) validator" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -630,6 +679,7 @@ restructuredtext-lint = "*" name = "flake8-string-format" version = "0.3.0" description = "string format checker, plugin for flake8" +category = "dev" optional = false python-versions = "*" files = [ @@ -644,6 +694,7 @@ flake8 = "*" name = "gitdb" version = "4.0.10" description = "Git Object Database" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -658,6 +709,7 @@ smmap = ">=3.0.1,<6" name = "gitpython" version = "3.1.40" description = "GitPython is a Python library used to interact with Git repositories" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -675,6 +727,7 @@ test = ["black", "coverage[toml]", "ddt (>=1.1.1,!=1.4.3)", "mock", "mypy", "pre name = "greenlet" version = "3.0.0" description = "Lightweight in-process concurrent programming" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -750,6 +803,7 @@ test = ["objgraph", "psutil"] name = "gunicorn" version = "21.2.0" description = "WSGI HTTP Server for UNIX" +category = "main" optional = false python-versions = ">=3.5" files = [ @@ -770,6 +824,7 @@ tornado = ["tornado (>=0.2)"] name = "h11" version = "0.14.0" description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -781,6 +836,7 @@ files = [ name = "httpcore" version = "0.16.3" description = "A minimal low-level HTTP client." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -792,16 +848,17 @@ files = [ anyio = ">=3.0,<5.0" certifi = "*" h11 = ">=0.13,<0.15" -sniffio = "==1.*" +sniffio = ">=1.0.0,<2.0.0" [package.extras] http2 = ["h2 (>=3,<5)"] -socks = ["socksio (==1.*)"] +socks = ["socksio (>=1.0.0,<2.0.0)"] [[package]] name = "httptools" version = "0.6.1" description = "A collection of framework independent HTTP protocol utils." +category = "main" optional = false python-versions = ">=3.8.0" files = [ @@ -850,6 +907,7 @@ test = ["Cython (>=0.29.24,<0.30.0)"] name = "httpx" version = "0.23.3" description = "The next generation HTTP client." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -865,14 +923,15 @@ sniffio = "*" [package.extras] brotli = ["brotli", "brotlicffi"] -cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<13)"] +cli = ["click (>=8.0.0,<9.0.0)", "pygments (>=2.0.0,<3.0.0)", "rich (>=10,<13)"] http2 = ["h2 (>=3,<5)"] -socks = ["socksio (==1.*)"] +socks = ["socksio (>=1.0.0,<2.0.0)"] [[package]] name = "identify" version = "2.5.30" description = "File identification library for Python" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -887,6 +946,7 @@ license = ["ukkonen"] name = "idna" version = "3.4" description = "Internationalized Domain Names in Applications (IDNA)" +category = "main" optional = false python-versions = ">=3.5" files = [ @@ -898,6 +958,7 @@ files = [ name = "iniconfig" version = "2.0.0" description = "brain-dead simple config-ini parsing" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -909,6 +970,7 @@ files = [ name = "isort" version = "5.12.0" description = "A Python utility / library to sort Python imports." +category = "dev" optional = false python-versions = ">=3.8.0" files = [ @@ -926,6 +988,7 @@ requirements-deprecated-finder = ["pip-api", "pipreqs"] name = "mako" version = "1.2.4" description = "A super-fast templating language that borrows the best ideas from the existing templating languages." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -945,6 +1008,7 @@ testing = ["pytest"] name = "markdown-it-py" version = "3.0.0" description = "Python port of markdown-it. Markdown parsing, done right!" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -969,6 +1033,7 @@ testing = ["coverage", "pytest", "pytest-cov", "pytest-regressions"] name = "markupsafe" version = "2.1.3" description = "Safely add untrusted strings to HTML/XML markup." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1038,6 +1103,7 @@ files = [ name = "mccabe" version = "0.6.1" description = "McCabe checker, plugin for flake8" +category = "dev" optional = false python-versions = "*" files = [ @@ -1049,6 +1115,7 @@ files = [ name = "mdurl" version = "0.1.2" description = "Markdown URL utilities" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1060,6 +1127,7 @@ files = [ name = "multidict" version = "6.0.4" description = "multidict implementation" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1143,6 +1211,7 @@ files = [ name = "mypy" version = "1.6.1" description = "Optional static typing for Python" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1189,6 +1258,7 @@ reports = ["lxml"] name = "mypy-extensions" version = "1.0.0" description = "Type system extensions for programs checked with the mypy type checker." +category = "dev" optional = false python-versions = ">=3.5" files = [ @@ -1200,6 +1270,7 @@ files = [ name = "nodeenv" version = "1.8.0" description = "Node.js virtual environment builder" +category = "dev" optional = false python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*" files = [ @@ -1214,6 +1285,7 @@ setuptools = "*" name = "ormar" version = "0.12.2" description = "An async ORM with fastapi in mind and pydantic validation." +category = "main" optional = false python-versions = ">=3.7.0,<4.0.0" files = [ @@ -1240,6 +1312,7 @@ sqlite = ["aiosqlite (>=0.17,<0.20)"] name = "packaging" version = "23.2" description = "Core utilities for Python packages" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1251,6 +1324,7 @@ files = [ name = "pathspec" version = "0.11.2" description = "Utility library for gitignore style pattern matching of file paths." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1262,6 +1336,7 @@ files = [ name = "pbr" version = "5.11.1" description = "Python Build Reasonableness" +category = "dev" optional = false python-versions = ">=2.6" files = [ @@ -1273,6 +1348,7 @@ files = [ name = "pep8-naming" version = "0.13.2" description = "Check PEP-8 naming conventions, plugin for flake8" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1287,6 +1363,7 @@ flake8 = ">=3.9.1" name = "platformdirs" version = "3.11.0" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1302,6 +1379,7 @@ test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4)", "pytest-co name = "pluggy" version = "1.3.0" description = "plugin and hook calling mechanisms for python" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1317,6 +1395,7 @@ testing = ["pytest", "pytest-benchmark"] name = "pre-commit" version = "3.5.0" description = "A framework for managing and maintaining multi-language pre-commit hooks." +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1335,6 +1414,7 @@ virtualenv = ">=20.10.0" name = "psycopg2-binary" version = "2.9.9" description = "psycopg2 - Python-PostgreSQL Database Adapter" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1364,6 +1444,7 @@ files = [ {file = "psycopg2_binary-2.9.9-cp311-cp311-win32.whl", hash = "sha256:dc4926288b2a3e9fd7b50dc6a1909a13bbdadfc67d93f3374d984e56f885579d"}, {file = "psycopg2_binary-2.9.9-cp311-cp311-win_amd64.whl", hash = "sha256:b76bedd166805480ab069612119ea636f5ab8f8771e640ae103e05a4aae3e417"}, {file = "psycopg2_binary-2.9.9-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:8532fd6e6e2dc57bcb3bc90b079c60de896d2128c5d9d6f24a63875a95a088cf"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b0605eaed3eb239e87df0d5e3c6489daae3f7388d455d0c0b4df899519c6a38d"}, {file = "psycopg2_binary-2.9.9-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8f8544b092a29a6ddd72f3556a9fcf249ec412e10ad28be6a0c0d948924f2212"}, {file = "psycopg2_binary-2.9.9-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2d423c8d8a3c82d08fe8af900ad5b613ce3632a1249fd6a223941d0735fce493"}, {file = "psycopg2_binary-2.9.9-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2e5afae772c00980525f6d6ecf7cbca55676296b580c0e6abb407f15f3706996"}, @@ -1372,6 +1453,8 @@ files = [ {file = "psycopg2_binary-2.9.9-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:cb16c65dcb648d0a43a2521f2f0a2300f40639f6f8c1ecbc662141e4e3e1ee07"}, {file = "psycopg2_binary-2.9.9-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:911dda9c487075abd54e644ccdf5e5c16773470a6a5d3826fda76699410066fb"}, {file = "psycopg2_binary-2.9.9-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:57fede879f08d23c85140a360c6a77709113efd1c993923c59fde17aa27599fe"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-win32.whl", hash = "sha256:64cf30263844fa208851ebb13b0732ce674d8ec6a0c86a4e160495d299ba3c93"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-win_amd64.whl", hash = "sha256:81ff62668af011f9a48787564ab7eded4e9fb17a4a6a74af5ffa6a457400d2ab"}, {file = "psycopg2_binary-2.9.9-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:2293b001e319ab0d869d660a704942c9e2cce19745262a8aba2115ef41a0a42a"}, {file = "psycopg2_binary-2.9.9-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:03ef7df18daf2c4c07e2695e8cfd5ee7f748a1d54d802330985a78d2a5a6dca9"}, {file = "psycopg2_binary-2.9.9-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0a602ea5aff39bb9fac6308e9c9d82b9a35c2bf288e184a816002c9fae930b77"}, @@ -1413,6 +1496,7 @@ files = [ name = "pycodestyle" version = "2.8.0" description = "Python style guide checker" +category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" files = [ @@ -1424,6 +1508,7 @@ files = [ name = "pydantic" version = "1.10.8" description = "Data validation and settings management using python type hints" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1477,6 +1562,7 @@ email = ["email-validator (>=1.0.3)"] name = "pydocstyle" version = "6.3.0" description = "Python docstring style checker" +category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -1494,6 +1580,7 @@ toml = ["tomli (>=1.2.3)"] name = "pyflakes" version = "2.4.0" description = "passive checker of Python programs" +category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -1505,6 +1592,7 @@ files = [ name = "pygments" version = "2.16.1" description = "Pygments is a syntax highlighting package written in Python." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1517,13 +1605,14 @@ plugins = ["importlib-metadata"] [[package]] name = "pytest" -version = "7.4.2" +version = "7.4.3" description = "pytest: simple powerful testing with Python" +category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "pytest-7.4.2-py3-none-any.whl", hash = "sha256:1d881c6124e08ff0a1bb75ba3ec0bfd8b5354a01c194ddd5a0a870a48d99b002"}, - {file = "pytest-7.4.2.tar.gz", hash = "sha256:a766259cfab564a2ad52cb1aae1b881a75c3eb7e34ca3779697c23ed47c47069"}, + {file = "pytest-7.4.3-py3-none-any.whl", hash = "sha256:0d009c083ea859a71b76adf7c1d502e4bc170b80a8ef002da5806527b9591fac"}, + {file = "pytest-7.4.3.tar.gz", hash = "sha256:d989d136982de4e3b29dabcc838ad581c64e8ed52c11fbe86ddebd9da0818cd5"}, ] [package.dependencies] @@ -1541,6 +1630,7 @@ testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "no name = "pytest-cov" version = "4.1.0" description = "Pytest plugin for measuring coverage." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1559,6 +1649,7 @@ testing = ["fields", "hunter", "process-tests", "pytest-xdist", "six", "virtuale name = "pytest-env" version = "0.8.2" description = "py.test plugin that allows you to add environment variables." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1572,10 +1663,26 @@ pytest = ">=7.3.1" [package.extras] test = ["coverage (>=7.2.7)", "pytest-mock (>=3.10)"] +[[package]] +name = "python-dateutil" +version = "2.8.2" +description = "Extensions to the standard Python datetime module" +category = "main" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +files = [ + {file = "python-dateutil-2.8.2.tar.gz", hash = "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"}, + {file = "python_dateutil-2.8.2-py2.py3-none-any.whl", hash = "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9"}, +] + +[package.dependencies] +six = ">=1.5" + [[package]] name = "python-dotenv" version = "1.0.0" description = "Read key-value pairs from a .env file and set them as environment variables" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1590,6 +1697,7 @@ cli = ["click (>=5.0)"] name = "pyyaml" version = "6.0.1" description = "YAML parser and emitter for Python" +category = "main" optional = false python-versions = ">=3.6" files = [ @@ -1649,6 +1757,7 @@ files = [ name = "restructuredtext-lint" version = "1.4.0" description = "reStructuredText linter" +category = "dev" optional = false python-versions = "*" files = [ @@ -1662,6 +1771,7 @@ docutils = ">=0.11,<1.0" name = "rfc3986" version = "1.5.0" description = "Validating URI References per RFC 3986" +category = "dev" optional = false python-versions = "*" files = [ @@ -1679,6 +1789,7 @@ idna2008 = ["idna"] name = "rich" version = "13.6.0" description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" +category = "dev" optional = false python-versions = ">=3.7.0" files = [ @@ -1697,6 +1808,7 @@ jupyter = ["ipywidgets (>=7.5.1,<9)"] name = "setuptools" version = "68.2.2" description = "Easily download, build, install, upgrade, and uninstall Python packages" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1709,10 +1821,23 @@ docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] testing-integration = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging (>=23.1)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] +[[package]] +name = "six" +version = "1.16.0" +description = "Python 2 and 3 compatibility utilities" +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +files = [ + {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, + {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, +] + [[package]] name = "smmap" version = "5.0.1" description = "A pure Python implementation of a sliding window memory map manager" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1724,6 +1849,7 @@ files = [ name = "sniffio" version = "1.3.0" description = "Sniff out which async library your code is running under" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1735,6 +1861,7 @@ files = [ name = "snowballstemmer" version = "2.2.0" description = "This package provides 29 stemmers for 28 languages generated from Snowball algorithms." +category = "dev" optional = false python-versions = "*" files = [ @@ -1746,6 +1873,7 @@ files = [ name = "sqlalchemy" version = "1.4.41" description = "Database Abstraction Library" +category = "main" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" files = [ @@ -1793,7 +1921,7 @@ files = [ ] [package.dependencies] -greenlet = {version = "!=0.4.17", markers = "python_version >= \"3\" and (platform_machine == \"aarch64\" or platform_machine == \"ppc64le\" or platform_machine == \"x86_64\" or platform_machine == \"amd64\" or platform_machine == \"AMD64\" or platform_machine == \"win32\" or platform_machine == \"WIN32\")"} +greenlet = {version = "!=0.4.17", markers = "python_version >= \"3\" and platform_machine == \"aarch64\" or python_version >= \"3\" and platform_machine == \"ppc64le\" or python_version >= \"3\" and platform_machine == \"x86_64\" or python_version >= \"3\" and platform_machine == \"amd64\" or python_version >= \"3\" and platform_machine == \"AMD64\" or python_version >= \"3\" and platform_machine == \"win32\" or python_version >= \"3\" and platform_machine == \"WIN32\""} [package.extras] aiomysql = ["aiomysql", "greenlet (!=0.4.17)"] @@ -1820,6 +1948,7 @@ sqlcipher = ["sqlcipher3-binary"] name = "starlette" version = "0.27.0" description = "The little ASGI library that shines." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1838,6 +1967,7 @@ full = ["httpx (>=0.22.0)", "itsdangerous", "jinja2", "python-multipart", "pyyam name = "stevedore" version = "5.1.0" description = "Manage dynamic plugins for Python applications" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1852,6 +1982,7 @@ pbr = ">=2.0.0,<2.1.0 || >2.1.0" name = "tomli" version = "2.0.1" description = "A lil' TOML parser" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1863,6 +1994,7 @@ files = [ name = "typing-extensions" version = "4.8.0" description = "Backported and Experimental Type Hints for Python 3.8+" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1874,6 +2006,7 @@ files = [ name = "ujson" version = "5.8.0" description = "Ultra fast JSON encoder and decoder for Python" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1944,6 +2077,7 @@ files = [ name = "uvicorn" version = "0.22.0" description = "The lightning-fast ASGI server." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1958,7 +2092,7 @@ h11 = ">=0.8" httptools = {version = ">=0.5.0", optional = true, markers = "extra == \"standard\""} python-dotenv = {version = ">=0.13", optional = true, markers = "extra == \"standard\""} pyyaml = {version = ">=5.1", optional = true, markers = "extra == \"standard\""} -uvloop = {version = ">=0.14.0,<0.15.0 || >0.15.0,<0.15.1 || >0.15.1", optional = true, markers = "(sys_platform != \"win32\" and sys_platform != \"cygwin\") and platform_python_implementation != \"PyPy\" and extra == \"standard\""} +uvloop = {version = ">=0.14.0,<0.15.0 || >0.15.0,<0.15.1 || >0.15.1", optional = true, markers = "sys_platform != \"win32\" and sys_platform != \"cygwin\" and platform_python_implementation != \"PyPy\" and extra == \"standard\""} watchfiles = {version = ">=0.13", optional = true, markers = "extra == \"standard\""} websockets = {version = ">=10.4", optional = true, markers = "extra == \"standard\""} @@ -1969,6 +2103,7 @@ standard = ["colorama (>=0.4)", "httptools (>=0.5.0)", "python-dotenv (>=0.13)", name = "uvloop" version = "0.18.0" description = "Fast implementation of asyncio event loop on top of libuv" +category = "main" optional = false python-versions = ">=3.7.0" files = [ @@ -2018,6 +2153,7 @@ test = ["Cython (>=0.29.36,<0.30.0)", "aiohttp (==3.9.0b0)", "aiohttp (>=3.8.1)" name = "virtualenv" version = "20.24.5" description = "Virtual Python Environment builder" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -2038,6 +2174,7 @@ test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess name = "watchfiles" version = "0.21.0" description = "Simple, modern and high performance file watching and code reload in python." +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2125,6 +2262,7 @@ anyio = ">=3.0.0" name = "websockets" version = "11.0.3" description = "An implementation of the WebSocket Protocol (RFC 6455 & 7692)" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2204,6 +2342,7 @@ files = [ name = "wemake-python-styleguide" version = "0.17.0" description = "The strictest and most opinionated python linter ever" +category = "dev" optional = false python-versions = ">=3.7,<4.0" files = [ @@ -2236,6 +2375,7 @@ typing_extensions = ">=4.0,<5.0" name = "yarl" version = "1.9.2" description = "Yet another URL library" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2322,4 +2462,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "c0dd57c780efa1374578cb09b61711b85a87f87641f1206f90fd603e11dccf1d" +content-hash = "26177479c37809d8aa3b48777f92dfc45e226edc832fcfcff41de7a38cddf066" diff --git a/pyproject.toml b/pyproject.toml index 67019ff..b8b29ec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,6 +23,8 @@ alembic = "^1.11.1" asyncpg = "^0.28.0" psycopg2-binary = "^2.9.6" httptools = "^0.6.0" +pytest = "^7.4.3" +faker = "^20.1.0" [tool.poetry.dev-dependencies]