-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtests.py
More file actions
31 lines (22 loc) · 610 Bytes
/
tests.py
File metadata and controls
31 lines (22 loc) · 610 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import unittest
from unittest import IsolatedAsyncioTestCase
from bot import hello
class Author:
def __init__(self):
self.name = "Test user"
class Message:
def __init__(self):
self.author = Author()
class Context:
def __init__(self):
self.message = Message()
def send(self, message):
return message
class Test(IsolatedAsyncioTestCase):
async def test_functionality(self):
ctx = Context()
result = await hello(ctx)
expected = "test"
self.assertEqual(expected, result)
if __name__ == "__main__":
unittest.main()