From 553480141fd590ab897186c577b2752dda0664ea Mon Sep 17 00:00:00 2001 From: Raventric <78981416+Ravencentric@users.noreply.github.com> Date: Sun, 17 Mar 2024 08:57:41 +0530 Subject: [PATCH] fix: tests (#2) * fix: minor cleanup * explicitly specify type --- README.md | 2 +- docs/index.md | 2 +- pyproject.toml | 1 + src/pyanilist/__init__.py | 11 ----------- src/pyanilist/_exceptions.py | 2 +- tests/test_anilist.py | 2 +- tests/test_async_anilist.py | 2 +- 7 files changed, 6 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 16f594d..26f3153 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ ## About - Supports both sync and async. -- Simple *read-only* API wrapper. +- Read-only API wrapper. - Only supports querying the `Media` type. ## Installation diff --git a/docs/index.md b/docs/index.md index 1401f2c..7f9c3b6 100644 --- a/docs/index.md +++ b/docs/index.md @@ -14,7 +14,7 @@ ## About - Supports both sync and async. -- Simple *read-only* API wrapper. +- Read-only API wrapper. - Only supports querying the `Media` type. ## Installation diff --git a/pyproject.toml b/pyproject.toml index e3ec32e..0ab6cf7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,6 +5,7 @@ description = "Simple read-only Anilist API wrapper" authors = ["Raventric <78981416+Ravencentric@users.noreply.github.com>"] license = "Unlicense" readme = "README.md" +keywords = ["anilist", "anime", "python"] packages = [{include = "pyanilist", from = "src"}] homepage = "https://ravencentric.github.io/pyanilist" repository = "https://github.com/Ravencentric/pyanilist" diff --git a/src/pyanilist/__init__.py b/src/pyanilist/__init__.py index fbceb7c..fe0691a 100644 --- a/src/pyanilist/__init__.py +++ b/src/pyanilist/__init__.py @@ -1,8 +1,3 @@ -from . import _clients as clients -from . import _enums as enums -from . import _exceptions as exceptions -from . import _models as models -from . import _types as types from ._clients import Anilist, AsyncAnilist from ._enums import ( CharacterRole, @@ -75,12 +70,6 @@ # Clients "AsyncAnilist", "Anilist", - # Modules - "clients", - "enums", - "exceptions", - "models", - "types", # Enums "CharacterRole", "ExternalLinkType", diff --git a/src/pyanilist/_exceptions.py b/src/pyanilist/_exceptions.py index 8669b2f..2a29f2f 100644 --- a/src/pyanilist/_exceptions.py +++ b/src/pyanilist/_exceptions.py @@ -33,7 +33,7 @@ WriteError, WriteTimeout, ) -from pydantic_core import ValidationError +from pydantic import ValidationError __all__ = [ "CloseError", diff --git a/tests/test_anilist.py b/tests/test_anilist.py index b5d8848..ba09be7 100644 --- a/tests/test_anilist.py +++ b/tests/test_anilist.py @@ -10,7 +10,7 @@ def test_anilist() -> None: - media = Anilist().search("Attack on titan") + media = Anilist().search("Attack on titan", type=MediaType.ANIME) assert media.title.romaji == "Shingeki no Kyojin" assert media.start_date.year == 2013 assert media.source == MediaSource.MANGA diff --git a/tests/test_async_anilist.py b/tests/test_async_anilist.py index b8266f1..7e12b6b 100644 --- a/tests/test_async_anilist.py +++ b/tests/test_async_anilist.py @@ -10,7 +10,7 @@ async def test_anilist() -> None: - media = await AsyncAnilist().search("Attack on titan") + media = await AsyncAnilist().search("Attack on titan", type=MediaType.ANIME) assert media.title.romaji == "Shingeki no Kyojin" assert media.start_date.year == 2013 assert media.source == MediaSource.MANGA