Skip to content

Commit

Permalink
fix: fix tests not working because of guilds list
Browse files Browse the repository at this point in the history
  • Loading branch information
null8626 committed Feb 18, 2025
1 parent e88d2a8 commit 15d962a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions tests/test_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from topgg import types

d: dict = {
"defAvatar": "6debd47ed13483642cf09e832ed0bc1b",
"invite": "",
"website": "https://top.gg",
"support": "KYZsaFb",
Expand Down Expand Up @@ -127,7 +126,7 @@ def test_bot_data_fields(bot_data: types.BotData) -> None:
for attr in bot_data:
if "id" in attr.lower():
assert isinstance(bot_data[attr], int) or bot_data[attr] is None
elif attr in ("owners", "guilds"):
elif attr == "owners":
for item in bot_data[attr]:
assert isinstance(item, int)
assert bot_data.get(attr) == bot_data[attr] == getattr(bot_data, attr)
Expand Down
8 changes: 4 additions & 4 deletions topgg/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,10 @@ def guilds(self) -> t.List[int]:

@property
def certified_bot(self) -> bool:
"""DEPRECATED: Certified bot is no longer supported by Top.gg API v0. At the moment, this will always be false."""
"""DEPRECATED: Certified bot is no longer supported by Top.gg API v0. At the moment, this will always be False."""

warnings.warn(
"Certified bot is no longer supported by Top.gg API v0. At the moment, this will always be false.",
"Certified bot is no longer supported by Top.gg API v0. At the moment, this will always be False.",
DeprecationWarning,
)
return False
Expand All @@ -313,10 +313,10 @@ def __init__(self, **kwargs: t.Any):

@property
def shards(self) -> t.List[int]:
"""DEPRECATED: Shard-related data is no longer supported by Top.gg API v0. At the moment, this will always return an empty array."""
"""DEPRECATED: Shard-related data is no longer supported by Top.gg API v0. At the moment, this will always return an empty list."""

warnings.warn(
"Shard-related data is no longer supported by Top.gg API v0. At the moment, this will always return an empty array.",
"Shard-related data is no longer supported by Top.gg API v0. At the moment, this will always return an empty list.",
DeprecationWarning,
)
return []
Expand Down

0 comments on commit 15d962a

Please sign in to comment.