Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md. Fixing issue #11

Merged
merged 5 commits into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

[![Python versions](https://img.shields.io/pypi/pyversions/sensei?color=%23F94526)](https://pypi.org/project/sensei/)
[![PyPi Version](https://img.shields.io/pypi/v/sensei?color=%23F94526)](https://pypi.org/project/sensei/)
[![PyPI Downloads](https://img.shields.io/pypi/dm/sensei?label=downloads&color=%23F94526)](https://pypi.org/project/sensei/)
[![Coverage](https://raw.githubusercontent.com/CrocoFactory/sensei/main/badges/coverage.svg)](https://pypi.org/project/sensei/)

The python framework, providing fast and robust way to build client-side API wrappers.

Expand Down
2 changes: 1 addition & 1 deletion badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ def test_rate_limit(self, base_url, sync_maker, base_maker):
base = base_maker(router)
model = sync_maker(router, base)

now = time.time()
model.get(1)
assert rate_limit._tokens == 1

Expand All @@ -88,6 +87,5 @@ async def test_async_rate_limit(self, base_url, async_maker, base_maker):
base = base_maker(router)
model = async_maker(router, base)

now = time.time()
await model.get(1) # type: ignore
assert rate_limit._tokens == 1
8 changes: 8 additions & 0 deletions tests/test_validation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest
from httpx import HTTPStatusError
from typing_extensions import Self
from sensei import APIModel

Expand Down Expand Up @@ -36,3 +37,10 @@ def delete(self) -> Self: ...

with pytest.raises(ValueError):
print(_ValidationModel().delete())

def test_raise_for_status(self, router, base_maker, sync_maker):
base = base_maker(router)
model = sync_maker(router, base)

with pytest.raises(HTTPStatusError):
model.get(0)
Loading