Skip to content

Commit

Permalink
ci: 3 seconds, it's joever
Browse files Browse the repository at this point in the history
  • Loading branch information
Ravencentric committed Mar 16, 2024
1 parent a91fb8f commit ad45ea7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
18 changes: 9 additions & 9 deletions tests/test_anilist.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


def test_anilist() -> None:
time.sleep(2)
time.sleep(3)
media = Anilist().search("Attack on titan")
assert media.title.romaji == "Shingeki no Kyojin"
assert media.start_date.year == 2013
Expand All @@ -25,7 +25,7 @@ def test_anilist() -> None:


def test_anilist_with_type_constraint() -> None:
time.sleep(2)
time.sleep(3)
media = Anilist().search("Attack on titan", type=MediaType.MANGA)
assert media.title.romaji == "Shingeki no Kyojin"
assert media.start_date.year == 2009
Expand All @@ -35,7 +35,7 @@ def test_anilist_with_type_constraint() -> None:


def test_anilist_with_some_constraints() -> None:
time.sleep(2)
time.sleep(3)
media = Anilist().search(
"violet evergarden", type=MediaType.MANGA, format=MediaFormat.NOVEL, status=MediaStatus.FINISHED
)
Expand All @@ -47,7 +47,7 @@ def test_anilist_with_some_constraints() -> None:


def test_anilist_with_all_constraints() -> None:
time.sleep(2)
time.sleep(3)
media = Anilist().search(
"My Hero Academia",
season=MediaSeason.SPRING,
Expand All @@ -64,25 +64,25 @@ def test_anilist_with_all_constraints() -> None:


def test_anilist_title_doesnt_exist() -> None:
time.sleep(2)
time.sleep(3)
with pytest.raises(HTTPStatusError, match="Not Found."):
Anilist().search("Title does not exist", type=MediaType.MANGA)


def test_anilist_bad_search_combo() -> None:
time.sleep(2)
time.sleep(3)
with pytest.raises(HTTPStatusError, match="Not Found."):
Anilist().search("Attack on titan", season_year=1999)


def test_anilist_wrong_input_types() -> None:
time.sleep(2)
time.sleep(3)
with pytest.raises(ValidationError):
Anilist().search(123456789, season_year="hello", type=True) # type: ignore


def test_anilist_id() -> None:
time.sleep(2)
time.sleep(3)
media = Anilist().get(16498)
assert media.title.romaji == "Shingeki no Kyojin"
assert media.start_date.year == 2013
Expand All @@ -92,6 +92,6 @@ def test_anilist_id() -> None:


def test_anilist_bad_id() -> None:
time.sleep(2)
time.sleep(3)
with pytest.raises(HTTPStatusError, match="400 Bad Request"):
Anilist().get(9999999999)
18 changes: 9 additions & 9 deletions tests/test_async_anilist.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


async def test_anilist() -> None:
time.sleep(2)
time.sleep(3)
media = await AsyncAnilist().search("Attack on titan")
assert media.title.romaji == "Shingeki no Kyojin"
assert media.start_date.year == 2013
Expand All @@ -25,7 +25,7 @@ async def test_anilist() -> None:


async def test_anilist_with_type_constraint() -> None:
time.sleep(2)
time.sleep(3)
media = await AsyncAnilist().search("Attack on titan", type=MediaType.MANGA)
assert media.title.romaji == "Shingeki no Kyojin"
assert media.start_date.year == 2009
Expand All @@ -35,7 +35,7 @@ async def test_anilist_with_type_constraint() -> None:


async def test_anilist_with_some_constraints() -> None:
time.sleep(2)
time.sleep(3)
media = await AsyncAnilist().search(
"violet evergarden", type=MediaType.MANGA, format=MediaFormat.NOVEL, status=MediaStatus.FINISHED
)
Expand All @@ -47,7 +47,7 @@ async def test_anilist_with_some_constraints() -> None:


async def test_anilist_with_all_constraints() -> None:
time.sleep(2)
time.sleep(3)
media = await AsyncAnilist().search(
"My Hero Academia",
season=MediaSeason.SPRING,
Expand All @@ -64,25 +64,25 @@ async def test_anilist_with_all_constraints() -> None:


async def test_anilist_title_doesnt_exist() -> None:
time.sleep(2)
time.sleep(3)
with pytest.raises(HTTPStatusError, match="Not Found."):
await AsyncAnilist().search("Title does not exist", type=MediaType.MANGA)


async def test_anilist_bad_search_combo() -> None:
time.sleep(2)
time.sleep(3)
with pytest.raises(HTTPStatusError, match="Not Found."):
await AsyncAnilist().search("Attack on titan", season_year=1999)


async def test_anilist_wrong_input_types() -> None:
time.sleep(2)
time.sleep(3)
with pytest.raises(ValidationError):
await AsyncAnilist().search(123456789, season_year="hello", type=True) # type: ignore


async def test_anilist_id() -> None:
time.sleep(2)
time.sleep(3)
media = await AsyncAnilist().get(16498)
assert media.title.romaji == "Shingeki no Kyojin"
assert media.start_date.year == 2013
Expand All @@ -92,6 +92,6 @@ async def test_anilist_id() -> None:


async def test_anilist_bad_id() -> None:
time.sleep(2)
time.sleep(3)
with pytest.raises(HTTPStatusError, match="400 Bad Request"):
await AsyncAnilist().get(9999999999)

0 comments on commit ad45ea7

Please sign in to comment.