From add53ec444fe6209941e5bbdda9dd7039863f110 Mon Sep 17 00:00:00 2001 From: Andrei Date: Fri, 14 Apr 2017 15:05:10 -0700 Subject: [PATCH] Add some tests around embeds --- tests/test_embeds.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tests/test_embeds.py diff --git a/tests/test_embeds.py b/tests/test_embeds.py new file mode 100644 index 0000000..ef60361 --- /dev/null +++ b/tests/test_embeds.py @@ -0,0 +1,32 @@ +from unittest import TestCase + +from datetime import datetime +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/') +