You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
855 B
30 lines
855 B
from unittest import TestCase
|
|
|
|
from disco.types.message import MessageEmbed
|
|
|
|
|
|
class TestEmbeds(TestCase):
|
|
def test_empty_embed(self):
|
|
embed = MessageEmbed()
|
|
self.assertDictEqual(
|
|
embed.to_dict(),
|
|
{
|
|
'image': {},
|
|
'author': {},
|
|
'video': {},
|
|
'thumbnail': {},
|
|
'footer': {},
|
|
'fields': [],
|
|
'type': 'rich',
|
|
})
|
|
|
|
def test_embed(self):
|
|
embed = MessageEmbed(
|
|
title='Test Title',
|
|
description='Test Description',
|
|
url='https://test.url/'
|
|
)
|
|
obj = embed.to_dict()
|
|
self.assertEqual(obj['title'], 'Test Title')
|
|
self.assertEqual(obj['description'], 'Test Description')
|
|
self.assertEqual(obj['url'], 'https://test.url/')
|
|
|