1
|
|
|
# Copyright Pincer 2021-Present |
|
|
|
|
2
|
|
|
# Full MIT License can be found in `LICENSE` at the project root. |
3
|
|
|
|
4
|
|
|
from pincer.objects.message import Embed |
5
|
|
|
|
6
|
|
|
DICT = { |
7
|
|
|
'title': 'Pincer - 0.6.4', |
8
|
|
|
'description': ( |
9
|
|
|
'🚀 An asynchronous python API wrapper meant ' |
10
|
|
|
'to replace discord.py\n> Snappy discord api ' |
11
|
|
|
'wrapper written with aiohttp & websockets' |
12
|
|
|
), |
13
|
|
|
'fields': [ |
14
|
|
|
{ |
15
|
|
|
'name': '**Github Repository**', |
16
|
|
|
'value': '> https://github.com/Pincer-org/Pincer' |
17
|
|
|
} |
18
|
|
|
], |
19
|
|
|
'image': { |
20
|
|
|
'url': ( |
21
|
|
|
'https://repository-images.githubusercontent.com/' |
22
|
|
|
'400871418/045ebf39-7c6e-4c3a-b744-0c3122374203' |
23
|
|
|
) |
24
|
|
|
}, |
25
|
|
|
'thumbnail': { |
26
|
|
|
'url': 'https://pincer.dev/img/icon.png' |
27
|
|
|
} |
28
|
|
|
} |
29
|
|
|
|
30
|
|
|
EMBED = Embed( |
31
|
|
|
title="Pincer - 0.6.4", |
32
|
|
|
description=( |
33
|
|
|
"🚀 An asynchronous python API wrapper meant to replace" |
34
|
|
|
" discord.py\n> Snappy discord api wrapper written " |
35
|
|
|
"with aiohttp & websockets" |
36
|
|
|
) |
37
|
|
|
).add_field( |
38
|
|
|
name="**Github Repository**", |
39
|
|
|
value="> https://github.com/Pincer-org/Pincer" |
40
|
|
|
).set_thumbnail( |
41
|
|
|
url="https://pincer.dev/img/icon.png" |
42
|
|
|
).set_image( |
43
|
|
|
url=( |
44
|
|
|
"https://repository-images.githubusercontent.com" |
45
|
|
|
"/400871418/045ebf39-7c6e-4c3a-b744-0c3122374203" |
46
|
|
|
) |
47
|
|
|
) |
48
|
|
|
|
49
|
|
|
|
50
|
|
|
def has_key_vals(actual, required): |
|
|
|
|
51
|
|
|
return all(actual.get(key) == val for key, val in required.items()) |
52
|
|
|
|
53
|
|
|
|
54
|
|
|
class TestDispatch: |
|
|
|
|
55
|
|
|
|
56
|
|
|
def test_embed_to_dict(self): |
|
|
|
|
57
|
|
|
""" |
58
|
|
|
Tests whether or not the dispatch class its string conversion |
59
|
|
|
is correct. |
60
|
|
|
""" |
61
|
|
|
assert has_key_vals(EMBED.to_dict(), DICT) |
62
|
|
|
|
63
|
|
|
def test_embed_from_dict(self): |
|
|
|
|
64
|
|
|
assert has_key_vals( |
65
|
|
|
Embed.from_dict(DICT).to_dict(), |
66
|
|
|
DICT |
67
|
|
|
) |
68
|
|
|
|