formated with formattor

This commit is contained in:
grey-cat-1908 2022-05-23 20:35:56 +03:00
parent 2750a1b1c3
commit ae571cfa05
4 changed files with 16 additions and 36 deletions

View file

@ -599,4 +599,4 @@ class UnavailableGuild(APIModelBase):
self.id = Snowflake(int(data["id"]))
self.unavailable = data["unavailable"]
return self
return self

View file

@ -16,7 +16,7 @@ guild_data = {
"MORE_EMOJI",
"INVITE_SPLASH",
"BANNER",
"COMMUNITY"
"COMMUNITY",
],
"emojis": [],
"banner": "9b6439a7de04f1d26af92f84ac9e1e4a",
@ -41,7 +41,7 @@ guild_data = {
"system_channel_flags": 0,
"preferred_locale": "en-US",
"rules_channel_id": "441688182833020939",
"public_updates_channel_id": "281283303326089216"
"public_updates_channel_id": "281283303326089216",
}
parsed_model = Guild.from_dict(guild_data)
@ -60,5 +60,5 @@ class TestGuildParsing:
"MORE_EMOJI",
"INVITE_SPLASH",
"BANNER",
"COMMUNITY"
"COMMUNITY",
]

View file

@ -12,22 +12,10 @@ class TestCache:
return CacheManager(**cache_params)
def test_count(self, cache):
cache._raw_guilds = {
Snowflake(123): 123,
Snowflake(1234): 1111
}
cache._raw_users = {
Snowflake(123): 123,
Snowflake(1234): 1111
}
cache._raw_dm_channels = {
Snowflake(123): 123,
Snowflake(1234): 1111
}
cache._channel_symlinks = {
Snowflake(123): 123,
Snowflake(1234): 1111
}
cache._raw_guilds = {Snowflake(123): 123, Snowflake(1234): 1111}
cache._raw_users = {Snowflake(123): 123, Snowflake(1234): 1111}
cache._raw_dm_channels = {Snowflake(123): 123, Snowflake(1234): 1111}
cache._channel_symlinks = {Snowflake(123): 123, Snowflake(1234): 1111}
assert cache.guilds_count() == 2
assert cache.users_count() == 2
@ -35,9 +23,7 @@ class TestCache:
assert cache.total_channels_count() == 4
def test_set_and_get_guild(self, cache):
cache.set_guild(
Guild.from_dict({"id": "123", "name": "test"})
)
cache.set_guild(Guild.from_dict({"id": "123", "name": "test"}))
assert cache.get_guild(123).name == "test"
@ -47,8 +33,6 @@ class TestCache:
cache.set_guild(
Guild.from_dict({"id": "123", "name": "test", "channels": [channel]})
)
cache.set_guild_channel(
TextChannel.from_dict(channel)
)
cache.set_guild_channel(TextChannel.from_dict(channel))
assert cache.get_guild_channel(456).name == "test"

View file

@ -3,16 +3,12 @@ import datetime
from melisa import Embed, Timestamp, Color
dict_embed = {
'title': 'my title',
'description': 'simple description',
'color': 252307,
'timestamp': datetime.datetime.utcfromtimestamp(1649748784).isoformat(),
'footer': {
'text': 'cool footer text'
},
'author': {
'name': 'best author'
},
"title": "my title",
"description": "simple description",
"color": 252307,
"timestamp": datetime.datetime.utcfromtimestamp(1649748784).isoformat(),
"footer": {"text": "cool footer text"},
"author": {"name": "best author"},
}
EMBED = Embed(title="my title", description="simple description")