-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmessage_test.py
More file actions
26 lines (16 loc) · 756 Bytes
/
Copy pathmessage_test.py
File metadata and controls
26 lines (16 loc) · 756 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
import unittest
from message import message_database
class TestApp(unittest.TestCase):
def test_message_database(self):
# As message_database is a template, should create an instance to run the functions
database = message_database()
database.save_message(number="07900000000", input="Good night")
message = database.read_message(number="07900000000")
# "self" are the functions included in unittest.TestCase
# assertEqual is only included in the unittest
self.assertEqual(message, "Good night")
def test_message_database_read_before_save(self):
database=message_database()
database.read_message(number="07900000000")
if __name__ == "__main__":
unittest.main()