3 changed files with 32 additions and 27 deletions
@ -1,22 +1,21 @@ |
|||||
from unittest import TestCase |
|
||||
|
|
||||
from disco.types.user import User, DefaultAvatars |
from disco.types.user import User, DefaultAvatars |
||||
|
|
||||
|
|
||||
class TestChannel(TestCase): |
def test_user_avatar_url(): |
||||
def test_user_avatar(self): |
u = User(id=12345, avatar='1234567890abcdefghijkl') |
||||
u = User( |
assert u.avatar_url == 'https://cdn.discordapp.com/avatars/12345/1234567890abcdefghijkl.webp?size=1024' |
||||
id=12345, |
avatar_url = u.get_avatar_url(still_format='png') |
||||
username='test123', |
assert avatar_url == 'https://cdn.discordapp.com/avatars/12345/1234567890abcdefghijkl.png?size=1024' |
||||
avatar='1234567890abcdefghijkl', |
|
||||
discriminator='1234', |
|
||||
bot=False) |
def test_user_animated_avatar_url(): |
||||
|
u = User(id=12345, avatar='a_1234567890abcdefghijkl') |
||||
|
assert u.avatar_url == 'https://cdn.discordapp.com/avatars/12345/a_1234567890abcdefghijkl.gif?size=1024' |
||||
|
avatar_url = u.get_avatar_url(animated_format='webp') |
||||
|
assert avatar_url == 'https://cdn.discordapp.com/avatars/12345/a_1234567890abcdefghijkl.webp?size=1024' |
||||
|
|
||||
self.assertEqual( |
|
||||
u.avatar_url, 'https://cdn.discordapp.com/avatars/12345/1234567890abcdefghijkl.webp?size=1024' |
|
||||
) |
|
||||
|
|
||||
def test_user_default_avatar(self): |
def test_user_default_avatar_url(): |
||||
u = User(id=123456, discriminator='1234') |
u = User(id=12345, discriminator='1234') |
||||
self.assertEqual(u.default_avatar, DefaultAvatars.RED) |
assert u.default_avatar == DefaultAvatars.RED |
||||
self.assertEqual(u.avatar_url, 'https://cdn.discordapp.com/embed/avatars/4.png') |
assert u.avatar_url == 'https://cdn.discordapp.com/embed/avatars/4.png' |
||||
|
Loading…
Reference in new issue