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.id = Snowflake(int(data["id"]))
self.unavailable = data["unavailable"] self.unavailable = data["unavailable"]
return self return self

View file

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

View file

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

View file

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